From 11272232772fcfa20f15e12efe37aad580ab3d8c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 24 May 2026 00:15:04 +0300 Subject: =?UTF-8?q?docs(rpn):=20fix=20Values()=20comment=20=E2=80=94=20cor?= =?UTF-8?q?rect=20order=20from=20top-to-bottom=20to=20bottom-to-top?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Values() returns slices.Clone(s.values) which preserves push order (bottom at index 0, top at last index). The existing comment contradicted both the implementation and the test documentation. --- internal/rpn/stack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/rpn/stack.go') diff --git a/internal/rpn/stack.go b/internal/rpn/stack.go index 6032a37..a0af494 100644 --- a/internal/rpn/stack.go +++ b/internal/rpn/stack.go @@ -51,7 +51,7 @@ func (s *Stack) Len() int { return len(s.values) } -// Values returns a copy of all stack values (top-to-bottom order). +// Values returns a copy of all stack values (bottom-to-top order). func (s *Stack) Values() []StackValue { return slices.Clone(s.values) } -- cgit v1.2.3