Browse Source

Optimisation + bugfix

Yann Weber 6 years ago
parent
commit
a698d20ddc
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      gte/rpnlib.py
  2. 1
    1
      gte/turmit.py

+ 1
- 1
gte/rpnlib.py View File

@@ -32,8 +32,8 @@ def RpnOp(method):
32 32
 
33 33
         @warning if result is None nothing is push
34 34
     '''
35
+    narg = len(inspect.signature(method).parameters)-1
35 36
     def wrapped(self):
36
-        narg = len(inspect.signature(method).parameters)-1
37 37
         args = [ self._pop() for _ in range(narg) ]
38 38
         args.reverse()
39 39
         try:

+ 1
- 1
gte/turmit.py View File

@@ -115,7 +115,7 @@ class Turmit(object):
115 115
             @param val int : value to push
116 116
         '''
117 117
         self._cur += 1
118
-        if self._cur >= len(self._stack) or abs(self._cur) > len(self._stack):
118
+        if self._cur >= len(self._stack) or abs(self._cur) >= len(self._stack):
119 119
             self._cur = 0
120 120
         self._stack[self._cur] = self._cast_int(val)
121 121
 

Loading…
Cancel
Save