mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
flagprocessor: add a fast path when flags is 0
When flags is 0, _processflags could be a no-op instead of iterating through the flag bits.
This commit is contained in:
parent
1cd2ffd1b5
commit
4656f56bb3
@ -1359,6 +1359,9 @@ class revlog(object):
|
||||
Note: If the ``raw`` argument is set, it has precedence over the
|
||||
operation and will only update the value of ``validatehash``.
|
||||
"""
|
||||
# fast path: no flag processors will run
|
||||
if flags == 0:
|
||||
return text, True
|
||||
if not operation in ('read', 'write'):
|
||||
raise ProgrammingError(_("invalid '%s' operation ") % (operation))
|
||||
# Check all flags are known.
|
||||
|
Loading…
Reference in New Issue
Block a user