Bug 143970 - Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
Summary: Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) construc...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-20 15:39 PDT by Chris Dumez
Modified: 2015-04-21 09:19 PDT (History)
5 users (show)

See Also:


Attachments
Patch (25.38 KB, patch)
2015-04-20 15:42 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (25.38 KB, patch)
2015-04-20 16:14 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (26.24 KB, patch)
2015-04-20 16:58 PDT, Chris Dumez
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-04-20 15:39:53 PDT
Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit as it copies the vector and it is easy to call it by mistake.
Comment 1 Chris Dumez 2015-04-20 15:42:03 PDT
Created attachment 251195 [details]
Patch
Comment 2 WebKit Commit Bot 2015-04-20 15:44:09 PDT
Attachment 251195 [details] did not pass style-queue:


ERROR: Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:71:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:308:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Chris Dumez 2015-04-20 16:14:46 PDT
Created attachment 251199 [details]
Patch
Comment 4 WebKit Commit Bot 2015-04-20 16:16:52 PDT
Attachment 251199 [details] did not pass style-queue:


ERROR: Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:71:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:308:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Chris Dumez 2015-04-20 16:58:05 PDT
Created attachment 251205 [details]
Patch
Comment 6 WebKit Commit Bot 2015-04-20 17:00:31 PDT
Attachment 251205 [details] did not pass style-queue:


ERROR: Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:71:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:308:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 23 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Darin Adler 2015-04-21 08:44:27 PDT
Comment on attachment 251205 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=251205&action=review

> Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp:155
> +        BlockList preOrder = m_graph.blocksInPreOrder();

How about auto?

> Source/WebCore/rendering/RenderGrid.cpp:174
> +                const auto& children = m_grid[row][column];

I think in a case like the the "const" does little good. If the object is already const, then auto& keeps it const. If it’s not already const, then all const does is make it non-modifiable for like one line of code below, at the expense of adding another word! Yuck.
Comment 8 Chris Dumez 2015-04-21 09:19:28 PDT
Committed r183065: <http://trac.webkit.org/changeset/183065>