Closed Bug 248694 Opened 20 years ago Closed 20 years ago

nsIParser::GetCommand is a wide string for no reason

Categories

(Core :: DOM: HTML Parser, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8alpha3

People

(Reporter: Biesinger, Assigned: Biesinger)

References

()

Details

Attachments

(1 file, 1 obsolete file)

all places would, really, prefer an nsACString&
Attached patch patch (obsolete) — Splinter Review
Attachment #151725 - Flags: review?(choess)
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8alpha2
oops, this misses a change to nsParser.h, to change the prototype to nsCString&
too... but I'm not going to attach a new patch for that unless requested
Target Milestone: mozilla1.8alpha2 → mozilla1.8beta
Attachment #151725 - Flags: superreview?(bzbarsky)
Attachment #151725 - Flags: review?(choess)
Attachment #151725 - Flags: review?(bzbarsky)
Comment on attachment 151725 [details] [diff] [review]
patch

>Index: parser/htmlparser/src/nsParser.cpp
>@@ -449,13 +449,13 @@ NS_IMETHODIMP_(void) nsParser::SetComman
>   nsCAutoString theCommand(aCommand);
>   if(theCommand.Equals(kViewSourceCommand))
>     mCommand=eViewSource;
>   else if(theCommand.Equals(kViewFragmentCommand))
>     mCommand=eViewFragment;
>   else mCommand=eViewNormal;
>-  mCommandStr.AssignWithConversion(aCommand);
>+  mCommandStr.Assign(aCommand);

Why not set mCommandStr up front and the eliminate theCommand (and just call
equals on mCommandStr in that if cascade)?

r+sr=bzbarsky with that change.
Attachment #151725 - Flags: superreview?(bzbarsky)
Attachment #151725 - Flags: superreview+
Attachment #151725 - Flags: review?(bzbarsky)
Attachment #151725 - Flags: review+
Checking in parser/htmlparser/public/nsIParser.h;
/cvsroot/mozilla/parser/htmlparser/public/nsIParser.h,v  <--  nsIParser.h
new revision: 1.26; previous revision: 1.25
done
Checking in parser/htmlparser/src/nsParser.cpp;
/cvsroot/mozilla/parser/htmlparser/src/nsParser.cpp,v  <--  nsParser.cpp
new revision: 3.345; previous revision: 3.344
done
Checking in parser/htmlparser/src/nsParser.h;
/cvsroot/mozilla/parser/htmlparser/src/nsParser.h,v  <--  nsParser.h
new revision: 3.128; previous revision: 3.127
done
Checking in content/xml/document/src/nsXMLContentSink.cpp;
/cvsroot/mozilla/content/xml/document/src/nsXMLContentSink.cpp,v  <-- 
nsXMLContentSink.cpp
new revision: 1.328; previous revision: 1.327
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.8beta → mozilla1.8alpha3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: