Cosmetics
This commit is contained in:
parent
c9b3a999bd
commit
7c24db334e
3 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@ type
|
||||||
next: ref Stack
|
next: ref Stack
|
||||||
|
|
||||||
func NewStack*(size: int = 32, next: ref Stack = nil): ref Stack =
|
func NewStack*(size: int = 32, next: ref Stack = nil): ref Stack =
|
||||||
result = new(Stack)
|
new(result)
|
||||||
result.size = size
|
result.size = size
|
||||||
result.data.setlen(size)
|
result.data.setlen(size)
|
||||||
result.next = next
|
result.next = next
|
||||||
|
|
|
@ -6,7 +6,7 @@ type
|
||||||
head: ref Stack
|
head: ref Stack
|
||||||
|
|
||||||
func NewStackStack*(): ref StackStack =
|
func NewStackStack*(): ref StackStack =
|
||||||
result = new(StackStack)
|
new(result)
|
||||||
result.head = NewStack()
|
result.head = NewStack()
|
||||||
result.height = 1
|
result.height = 1
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ suite "StackStack":
|
||||||
check empty[].Pop() == 0
|
check empty[].Pop() == 0
|
||||||
test "End":
|
test "End":
|
||||||
var empty = NewStackStack()
|
var empty = NewStackStack()
|
||||||
var v: tuple[x,y: int] = (0, 0)
|
var v: tuple[x, y: int] = (0, 0)
|
||||||
empty[].Push(1)
|
empty[].Push(1)
|
||||||
check empty[].End(v) == true
|
check empty[].End(v) == true
|
||||||
check empty.height == 1
|
check empty.height == 1
|
||||||
|
|
Reference in a new issue