diff options
author | Julien Dessaux | 2022-08-20 09:25:57 +0200 |
---|---|---|
committer | Julien Dessaux | 2022-08-20 09:25:57 +0200 |
commit | 544a3f376371750d97e1b17d01d4e522946c2f9d (patch) | |
tree | 284aa6789e32ad017259c2634186e92b4b116391 /src/stack.nim | |
parent | Fixed bug in the handling of end command failure (diff) | |
download | nimfunge98-1.1.2.tar.gz nimfunge98-1.1.2.tar.bz2 nimfunge98-1.1.2.zip |
Fixed stack duplicate behaviour1.1.2
Diffstat (limited to 'src/stack.nim')
-rw-r--r-- | src/stack.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stack.nim b/src/stack.nim index d6493a3..ef7edf8 100644 --- a/src/stack.nim +++ b/src/stack.nim @@ -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 |