internal/core/convert: allocate vertices in ensureArcVertex better
Allocate once rather than twice in the helper.
The use of a one-element array rather than using append
also avoids extra capacity in the slice, which is wasted space.
│ old │ new │
│ B/op │ B/op vs base │
VetInventory 4.613Gi ± ∞ ¹ 4.602Gi ± ∞ ¹ -0.23% (p=1.000 n=1)
│ old │ new │
│ allocs/op │ allocs/op vs base │
VetInventory 49.06M ± ∞ ¹ 48.33M ± ∞ ¹ -1.50% (p=1.000 n=1)
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ia1cb03bc80e85603d4525188369dfeedb69f86fb
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1229434
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Matthew Sackman <matthew@cue.works>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>