aboutsummaryrefslogtreecommitdiff
path: root/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'stack.go')
-rw-r--r--stack.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/stack.go b/stack.go
index c192878..dc49570 100644
--- a/stack.go
+++ b/stack.go
@@ -15,11 +15,12 @@ func (s *stack) push(v uint16) {
}
func (s *stack) pop() uint16 {
- defer s.move(-1)
- return s.peek()
+ v := s.get()
+ s.move(-1)
+ return v
}
-func (s *stack) peek() uint16 {
+func (s *stack) get() uint16 {
return s.data[s.sp]
}