mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
Bug 1173306 - Remove expensive regexp for handling multiline comments when reading pref files in mozprofile, r=ahal
This commit is contained in:
parent
eb9b4388cc
commit
023cc5a643
@ -164,8 +164,6 @@ class Preferences(object):
|
||||
to str.format to interpolate preference values.
|
||||
"""
|
||||
|
||||
comment = re.compile('/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/', re.MULTILINE)
|
||||
|
||||
marker = '##//' # magical marker
|
||||
lines = [i.strip() for i in mozfile.load(path).readlines() if i.strip()]
|
||||
_lines = []
|
||||
@ -176,7 +174,6 @@ class Preferences(object):
|
||||
line = line.replace('//', marker)
|
||||
_lines.append(line)
|
||||
string = '\n'.join(_lines)
|
||||
string = re.sub(comment, '', string)
|
||||
|
||||
# skip trailing comments
|
||||
processed_tokens = []
|
||||
|
Loading…
Reference in New Issue
Block a user