aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stack.nim2
-rw-r--r--tests/stack.nim4
2 files changed, 1 insertions, 5 deletions
diff --git a/src/stack.nim b/src/stack.nim
index b100263..d6493a3 100644
--- a/src/stack.nim
+++ b/src/stack.nim
@@ -48,8 +48,6 @@ func Clear*(s: var Stack) =
func Duplicate*(s: var Stack) =
if s.height > 0:
s.Push(s.data[s.height-1])
- else:
- s.PushVector((0, 0))
func Swap*(s: var Stack) =
let a = s.Pop
diff --git a/tests/stack.nim b/tests/stack.nim
index bf02299..e041a80 100644
--- a/tests/stack.nim
+++ b/tests/stack.nim
@@ -72,9 +72,7 @@ suite "Stack":
test "Duplicate":
var empty = NewStack()
empty[].Duplicate()
- check empty.height == 2
- check empty.data[0] == 0
- check empty.data[1] == 0
+ check empty[].Pop() == 0
var some = NewStack()
some[].Push(2)
some[].Push(-4)