aboutsummaryrefslogtreecommitdiff
path: root/stack.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-01-09 01:32:41 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-01-09 01:32:41 +0100
commit6c341b31fc36157be445ad106257a3bba4abc87d (patch)
tree76a639608a538cf0664ed0b2b614c7409d460eec /stack.go
parentf8a2141c0776a28c6a7107849102154f9a959f48 (diff)
rename
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]
}