pulumi/pkg/resource/deploy
Fraser Waters 571fadae3f Use slice.Prealloc instead of make([]T, 0, ...)
Fixes https://github.com/pulumi/pulumi/issues/12738

https://github.com/pulumi/pulumi/pull/11834 turned on the prealloc
linter and changed a load of slice uses from just `var x T[]` to `x :=
make([]T, 0, preallocSize)`. This was good for performance but it turns
out there are a number of places in the codebase that treat a `nil`
slice as semnatically different to an empty slice.

Trying to test that, or even reason that through for every callsite is
untractable, so this PR replaces all expressions of the form `make([]T,
0, size)` with a call to `slice.Prealloc[T](size)`. When size is 0 that
returns a nil array, rather than an empty array.
2023-06-29 11:27:50 +01:00
..
deploytest Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
providers Don't try to install provider during schema loading unless missing 2023-06-28 14:12:17 +01:00
builtins.go Send old inputs to diff and update 2023-06-21 21:04:50 +01:00
deployment.go Consolidated Target parameters 2023-06-08 08:42:03 -07:00
deployment_executor.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
deployment_executor_test.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
deployment_test.go Remove source_fixed 2022-11-08 15:55:45 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
import.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
manifest.go Split Manifest type to it's own file (#8712) 2022-01-10 12:25:24 +00:00
plan.go all: Fix revive issues 2023-03-21 08:55:11 -07:00
snapshot.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
snapshot_test.go all: Fix revive issues 2023-03-21 08:55:11 -07:00
source.go Monitor.Invoke and Provider.Invoke take different arguments (#9323) 2022-04-14 10:59:46 +01:00
source_error.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
source_eval.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
source_eval_test.go Maintain alias compat for older Node.js SDKs on new CLIs 2023-06-14 08:34:32 -07:00
source_null.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
source_query.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
source_query_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
state_builder.go all: Fix revive issues 2023-03-21 08:55:11 -07:00
state_builder_test.go Non-mutating snapshot normalization (#10128) 2022-07-18 14:04:19 -04:00
step.go Merge #13139 2023-06-23 07:14:31 +00:00
step_executor.go Mark outputs secret if there is a matching secret input. 2023-06-23 09:24:21 -07:00
step_generator.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
step_generator_test.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
target.go Add getOrganization to nodejs and python (#10504) 2022-08-31 10:33:29 +01:00