summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2019-10-08 22:33:29 -0400
committerGitHub <noreply@github.com>2019-10-08 22:33:29 -0400
commit9c0c66e0c16f68a7a0bb2eb2c5e8ae23c9c272d2 (patch)
tree00548c8ed982b2ee009a942366beda5a60a500e9
parent88082fa190f1127c996e8ddd1d5a83488a79bed2 (diff)
downloaddjango-alex-patch-1.tar.gz
Added a helpful commentalex-patch-1
-rw-r--r--django/template/base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/template/base.py b/django/template/base.py
index d8a35f2768..296c1307c0 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -405,6 +405,9 @@ class DebugLexer(Lexer):
class Parser:
def __init__(self, tokens, libraries=None, builtins=None, origin=None):
+ # We reverse the tokens so `next_token`, `prepend_token`, and
+ # `delete_first_token` can all operate at the end of the list, which
+ # is O(1).
self.tokens = list(reversed(tokens))
self.tags = {}
self.filters = {}