diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-04-05 17:18:05 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-04-05 17:18:05 +0200 |
commit | 231e2367fc520c9bbfcb7e3c21bb0a65f6b63f9b (patch) | |
tree | 1ec0d3410a54074a5d38f72dac81aff8bc467896 | |
parent | e31bf70c44c85559d5743fdd645ba6936b83c49d (diff) |
Make it a bit faster
-rw-r--r-- | stack.go | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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 |