]> Devi Nivas Git - chevron.git/commitdiff
Use endswith instead of splicing
authornoah morrison <noah@morrison.ph>
Sat, 15 Nov 2014 03:02:14 +0000 (22:02 -0500)
committernoah morrison <noah@morrison.ph>
Sat, 15 Nov 2014 03:02:14 +0000 (22:02 -0500)
entei.py

index 0958f3ee7427025fc85e5c24b2c7dad313283e98..c1e218d65d657d54e9ada7a93626265a02705b74 100755 (executable)
--- a/entei.py
+++ b/entei.py
@@ -45,7 +45,7 @@ def tokenize(template):
         until = until or l_del
         literal = get()
         while not template.is_finished:
-            if literal[-len(until):] == until:
+            if literal.endswith(until):
                 return literal[:-len(until)]
 
             literal += get()