WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
129427
Some small modernizing tweaks to the coding style guide
https://bugs.webkit.org/show_bug.cgi?id=129427
Summary
Some small modernizing tweaks to the coding style guide
Darin Adler
Reported
2014-02-27 08:59:11 PST
Change coding style guide to specify nullptr instead of 0, and other small modernizing tweaks
Attachments
Patch
(5.70 KB, patch)
2014-02-27 09:03 PST
,
Darin Adler
ap
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2014-02-27 09:03:42 PST
Created
attachment 225374
[details]
Patch
Alexey Proskuryakov
Comment 2
2014-02-28 10:05:56 PST
Comment on
attachment 225374
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=225374&action=review
> Websites/webkit.org/ChangeLog:14 > + without non-WebKit-style abbreviations and such. Use auto& instead of const auto& in for loop > + example, since that's normally preferred. Changed section title to say "zero" instead of "0".
This is one part I'm not sure of. We have a lot of "const auto&" loop variables currently in the tree, and I personally like those.
Darin Adler
Comment 3
2014-02-28 12:39:11 PST
(In reply to
comment #2
)
> This is one part I'm not sure of. We have a lot of "const auto&" loop variables currently in the tree, and I personally like those.
The compiler will automatically propagate the const from the collection if begin/end are overloaded suitably. How critical is it to narrow the reference to read-only in cases where the access to the collection is not already read-only? Is it worth an extra keyword on every one of these for loops?
Darin Adler
Comment 4
2014-03-01 15:24:49 PST
Comment on
attachment 225374
[details]
Patch For now I will land with "auto&". We can change back later if we confirm that "const auto&" is preferred.
Darin Adler
Comment 5
2014-03-01 15:25:21 PST
Committed
r164930
: <
http://trac.webkit.org/changeset/164930
>
Joseph Pecoraro
Comment 6
2014-03-03 14:48:14 PST
Comment on
attachment 225374
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=225374&action=review
> Websites/webkit.org/ChangeLog:17 > + over index iteration in vector iteration example and also showed use of unsigned rather than > + size_t since that is almost always what we want. Eliminated the use of PassOwnPtr in the "return
Why is "unsigned rather than size_t" preferred? Shouldn't we match the type that the method / object produces?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug