Strip comments out of default prefs files
Categories
(Core :: Preferences: Backend, enhancement)
Tracking
()
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(3 files)
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
It's not used, probably because it's pretty strange and hard to imagine using
safely. (Stripping leading and trailing space could be useful, but collapsing
sequences of spaces? Hmm.)
Assignee | ||
Comment 2•4 years ago
|
||
This commit does the following.
-
Renames
slashslash
asdumbComments
. As a result, it now comes before
emptyLines
in alphabetical ordering, which means that if you apply both
dumbComments
andemptyLines
, lines that contain only comments will be
fully removed.(I contemplated changing the filter ordering to match the order specified,
rather than using alphabetical ordering, but that was more invasive and not
obviously better.) -
Changes
dumbComments
so it only applies if the comment is at the start of
the line (with optional leading whitespace). This is so it can be used with
prefs files, which contain lines likepref("foo", "https://mozilla.org");
where the//
must not be treated as a comment.
Note that slashslash
wasn't being used anywhere.
Depends on D88240
Assignee | ||
Comment 3•4 years ago
|
||
For a local build on my Linux64 box, this reduces greprefs.js from 174,906
bytes to 103,221 bytes, and firefox.js from 112,100 bytes to 68,656 bytes.
Depends on D88242
Comment 5•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/76efaf59feb8
https://hg.mozilla.org/mozilla-central/rev/bcc9e11ca06b
https://hg.mozilla.org/mozilla-central/rev/328067bcffe8
Updated•4 years ago
|
Description
•