From 9dd16cddc2d712c3aad0b0a5c8a5a1227e36a1c7 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 24 May 2026 13:41:11 +0300 Subject: fix(rpn): remove duplicate ConstantsProvider initialization (task 4j) NewOperations() no longer creates a ConstantsProvider internally since NewRPN() always calls SetConstants() immediately after. Eliminates a wasted allocation with no behavioral change. --- internal/rpn/operations.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/rpn/operations.go b/internal/rpn/operations.go index 3dfc7c2..a3d660c 100644 --- a/internal/rpn/operations.go +++ b/internal/rpn/operations.go @@ -29,17 +29,15 @@ var ( ) // NewOperations creates a new Operations instance with the given variable store. -// Creates a new ConstantsProvider internally; use SetConstants to replace it. +// Does not create a ConstantsProvider internally; caller must use SetConstants. // If no registry is provided, defaults to the global MetricRegistry. func NewOperations(vars VariableStore, reg ...*MetricRegistry) *Operations { - consts := NewConstants() r := GetMetricRegistry() if len(reg) > 0 && reg[0] != nil { r = reg[0] } return &Operations{ vars: vars, - consts: consts, mode: FloatMode, // default prefixMode: SI, // default metricRegistry: r, -- cgit v1.2.3