aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stack.nim2
-rw-r--r--src/stackStack.nim2
-rw-r--r--tests/stackStack.nim2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/stack.nim b/src/stack.nim
index 9ba3e24..f08baf0 100644
--- a/src/stack.nim
+++ b/src/stack.nim
@@ -5,7 +5,7 @@ type
next: ref Stack
func NewStack*(size: int = 32, next: ref Stack = nil): ref Stack =
- result = new(Stack)
+ new(result)
result.size = size
result.data.setlen(size)
result.next = next
diff --git a/src/stackStack.nim b/src/stackStack.nim
index 1bc89c0..d55d5d9 100644
--- a/src/stackStack.nim
+++ b/src/stackStack.nim
@@ -6,7 +6,7 @@ type
head: ref Stack
func NewStackStack*(): ref StackStack =
- result = new(StackStack)
+ new(result)
result.head = NewStack()
result.height = 1
diff --git a/tests/stackStack.nim b/tests/stackStack.nim
index 9f3c176..5451d79 100644
--- a/tests/stackStack.nim
+++ b/tests/stackStack.nim
@@ -60,7 +60,7 @@ suite "StackStack":
check empty[].Pop() == 0
test "End":
var empty = NewStackStack()
- var v: tuple[x,y: int] = (0, 0)
+ var v: tuple[x, y: int] = (0, 0)
empty[].Push(1)
check empty[].End(v) == true
check empty.height == 1