summaryrefslogtreecommitdiff
path: root/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'stack.go')
-rw-r--r--stack.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/stack.go b/stack.go
index eb9b6be..33c8357 100644
--- a/stack.go
+++ b/stack.go
@@ -19,9 +19,7 @@ func (s *Stack) Push(v Value) {
// Insert inserts value at head
func (s *Stack) Insert(v Value) {
- *s = append(*s, 0)
- copy((*s)[1:], (*s)[:len(*s)-1])
- (*s)[0] = v
+ *s = append(Stack{v}, *s...)
}
// Pop retrieves value from tail