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
David Kilzer (:ddkilzer)
2011-11-15 07:55:43 PST
Created attachment 115168 [details]
Patch v1
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? (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. 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. 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!
Comment on attachment 115168 [details] Patch v1 Clearing flags on attachment: 115168 Committed r100298: <http://trac.webkit.org/changeset/100298> All reviewed patches have been landed. Closing bug. |