mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1325995 - Misc fixes.
MozReview-Commit-ID: IcJvNv6rWSt
This commit is contained in:
parent
c66c9fccda
commit
4e282917d8
@ -52,7 +52,8 @@ TruncateComments(const nsAString& src, nsAString* const out)
|
||||
|
||||
const nsString commentBeginnings[] = { NS_LITERAL_STRING("//"),
|
||||
NS_LITERAL_STRING("/*"),
|
||||
nsString() };
|
||||
nsString() }; // Final empty string for "found
|
||||
// nothing".
|
||||
const nsString lineCommentEndings[] = { NS_LITERAL_STRING("\\\n"),
|
||||
NS_LITERAL_STRING("\n"),
|
||||
nsString() };
|
||||
@ -63,8 +64,10 @@ TruncateComments(const nsAString& src, nsAString* const out)
|
||||
while (srcItr != srcEnd) {
|
||||
size_t foundId;
|
||||
fnEmitUntil( fnFindSoonestOf(commentBeginnings, 2, &foundId) );
|
||||
fnEmitUntil(srcItr + commentBeginnings[foundId].Length());
|
||||
|
||||
fnEmitUntil(srcItr + commentBeginnings[foundId].Length()); // Final empty string
|
||||
// allows us to skip
|
||||
// forward here
|
||||
// unconditionally.
|
||||
switch (foundId) {
|
||||
case 0: // line comment
|
||||
while (true) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user