Bug 1173306 - Remove expensive regexp for handling multiline comments when reading pref files in mozprofile, r=ahal

This commit is contained in:
James Graham 2015-06-09 14:51:11 +01:00
parent eb9b4388cc
commit 023cc5a643

View File

@ -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 = []