summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-24 00:12:08 +0300
committerPaul Buetow <paul@buetow.org>2026-05-24 00:12:08 +0300
commit573792cbd153d9c7318c180e6a1e4eadf0e5bd3f (patch)
tree02f6840accaf6723a3d56a510999fbba7a388c32
parent066a65487a8937f1754b3daf246702fdbf9f3a5c (diff)
docs(rpn): fix inaccurate Stack() return value comment
The comment claimed Stack() returns nil for an empty stack, but GetCurrentStack() uses slices.Clone() which preserves a non-nil empty slice. Only returns nil if the internal currentStack pointer is nil, which should not happen in normal usage.
-rw-r--r--internal/rpn/rpn_state.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/rpn/rpn_state.go b/internal/rpn/rpn_state.go
index 5797ebe..baf64de 100644
--- a/internal/rpn/rpn_state.go
+++ b/internal/rpn/rpn_state.go
@@ -96,7 +96,7 @@ func (r *RPN) SetCurrentStack(values []StackValue) {
// Stack returns the current stack as a slice of StackValues.
// This is a convenience wrapper around GetCurrentStack().
-// Returns nil if the stack is empty or nil.
+// Returns an empty slice if the stack has no values.
func (r *RPN) Stack() []StackValue {
return r.GetCurrentStack()
}