Fixed stack duplicate behaviour
This commit is contained in:
parent
e431feb6cb
commit
544a3f3763
1 changed files with 2 additions and 2 deletions
|
@ -46,8 +46,8 @@ func Clear*(s: var Stack) =
|
|||
s.height = 0
|
||||
|
||||
func Duplicate*(s: var Stack) =
|
||||
if s.height > 0:
|
||||
s.Push(s.data[s.height-1])
|
||||
let v = s.Pop()
|
||||
s.PushVector((v, v));
|
||||
|
||||
func Swap*(s: var Stack) =
|
||||
let a = s.Pop
|
||||
|
|
Reference in a new issue