mirror of
https://github.com/prometheus/prometheus.git
synced 2025-09-21 13:51:00 +02:00
Currently it allocates at least once on every recursion, and since `append` gives no extra space for 1 or 2 elements, will allocate several times for even modestly complex expressions. Instead, allocate space for 4 elements to begin, and defer adding another until we need it. Add a note that `path` may get overwritten; this was true previously. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>