Bug 72387

Summary: Remove useless const modifier from KURL::init
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebCore Misc.Assignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, koivisto, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 71921    
Bug Blocks:    
Attachments:
Description Flags
Patch v1 none

David Kilzer (:ddkilzer)
Reported 2011-11-15 07:55:43 PST
Follow-up to Bug 71921 Comment #17.
Attachments
Patch v1 (1.30 KB, patch)
2011-11-15 08:06 PST, David Kilzer (:ddkilzer)
no flags
David Kilzer (:ddkilzer)
Comment 1 2011-11-15 08:06:36 PST
Created attachment 115168 [details] Patch v1
Andreas Kling
Comment 2 2011-11-15 08:45:02 PST
Comment on attachment 115168 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=115168&action=review > Source/WebCore/platform/KURL.cpp:489 > - const char* bufferStart = bufferPos; > + char* bufferStart = bufferPos; Why is this const useless but the ones further down (baseString, baseStringStart, pathStart, baseStringEnd, relStringStart, relStringPos) aren't?
David Kilzer (:ddkilzer)
Comment 3 2011-11-15 08:52:40 PST
(In reply to comment #2) > (From update of attachment 115168 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=115168&action=review > > > Source/WebCore/platform/KURL.cpp:489 > > - const char* bufferStart = bufferPos; > > + char* bufferStart = bufferPos; > > Why is this const useless but the ones further down (baseString, baseStringStart, pathStart, baseStringEnd, relStringStart, relStringPos) aren't? Per Darin's statement in Bug 71921 Comment #17, they would be useless as well. This patch was only to remove the useless 'const' modifier I added for Bug 71921, but I can remove the rest if that's what the consensus is.
Darin Adler
Comment 4 2011-11-15 10:14:32 PST
We use const char* all the time, and I did not mean to imply that was useless. I am not saying that the const keyword is useless, just that making actual local variables const is not something we do in most WebKit code. Not the characters that a local variable points to, the local variable itself.
Darin Adler
Comment 5 2011-11-15 10:15:49 PST
Comment on attachment 115168 [details] Patch v1 Given that this is a pointer into a buffer of non-const characters, I think it's fine for it to be char*, even though I did not mean to claim this was useless at all!
WebKit Review Bot
Comment 6 2011-11-15 11:16:57 PST
Comment on attachment 115168 [details] Patch v1 Clearing flags on attachment: 115168 Committed r100298: <http://trac.webkit.org/changeset/100298>
WebKit Review Bot
Comment 7 2011-11-15 11:17:01 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.