summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/rpn/operations_arithmetic.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/internal/rpn/operations_arithmetic.go b/internal/rpn/operations_arithmetic.go
index 96676b8..8504d34 100644
--- a/internal/rpn/operations_arithmetic.go
+++ b/internal/rpn/operations_arithmetic.go
@@ -107,7 +107,7 @@ func (o *Operations) Multiply(stack *Stack) error {
// Divide pops two values from stack, divides (a / b), and pushes result.
func (o *Operations) Divide(stack *Stack) error {
- b, err := popStack(stack, "/")
+ a, b, err := popTwo(stack, "/")
if err != nil {
return err
}
@@ -120,11 +120,6 @@ func (o *Operations) Divide(stack *Stack) error {
return buildError("/", fmt.Errorf("division by zero"))
}
- a, err := popStack(stack, "/")
- if err != nil {
- return err
- }
-
aM, err := resolveMetric(o.metricRegistry, a)
if err != nil {
return buildError("/", err)