match: use _BASE_SIZE instead of magic value 4
authorMartin von Zweigbergk <martinvonz@google.com>
Sun, 02 Dec 2018 13:45:20 -0800
changeset 40781 e115a6452b41
parent 40780 1e019f45fa88
child 40782 3984409e144b
match: use _BASE_SIZE instead of magic value 4 Differential Revision: https://phab.mercurial-scm.org/D5351
mercurial/match.py
--- a/mercurial/match.py	Sun Dec 02 13:44:49 2018 -0800
+++ b/mercurial/match.py	Sun Dec 02 13:45:20 2018 -0800
@@ -1212,7 +1212,7 @@
         groupsize = _BASE_SIZE
         for idx, r in enumerate(regexps):
             piecesize = len(r)
-            if (piecesize + 4) > MAX_RE_SIZE:
+            if (piecesize + _BASE_SIZE) > MAX_RE_SIZE:
                 msg = _("matcher pattern is too long (%d bytes)") % piecesize
                 raise error.Abort(msg)
             elif (groupsize + piecesize) > MAX_RE_SIZE: