From 6c341b31fc36157be445ad106257a3bba4abc87d Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 9 Jan 2018 01:32:41 +0100 Subject: rename --- stack.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'stack.go') 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] } -- cgit v1.2.3