Closed
Bug 1346737
Opened 8 years ago
Closed 7 years ago
Use a const in the for loop declaration to avoid copy in nsGlobalWindow.cpp
Categories
(Developer Infrastructure :: Source Code Analysis, enhancement)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox55 affected)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox55 | --- | affected |
People
(Reporter: Sylvestre, Assigned: andi)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Found by clang-tidy
http://clang.llvm.org/extra/clang-tidy/checks/performance-for-range-copy.html
Comment hidden (mozreview-request) |
Comment 2•8 years ago
|
||
mozreview-review |
Comment on attachment 8846586 [details]
Bug 1346737 - Use a const in the for loop declaration to avoid copy in nsGlobalWindow.cpp
https://reviewboard.mozilla.org/r/119626/#review121638
Nice!!!
Attachment #8846586 -
Flags: review?(ehsan) → review+
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/753843fed8a9
Use a const in the for loop declaration to avoid copy in nsGlobalWindow.cpp r=Ehsan
Comment 4•8 years ago
|
||
Backed for build bustage:
https://hg.mozilla.org/integration/autoland/rev/b982b56e56682eb9384ce348513cf2570fb9596b
Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=753843fed8a927a6101d48c830e9d592edbf9ce8&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=retry&filter-resultStatus=usercancel&filter-resultStatus=runnable
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=84029184&repo=autoland
[task 2017-03-15T14:48:29.991958Z] 14:48:29 INFO - /home/worker/workspace/build/src/dom/base/nsGlobalWindow.cpp: In member function 'void nsGlobalWindow::DispatchVRDisplayPresentChange(uint32_t)':
[task 2017-03-15T14:48:29.992785Z] 14:48:29 INFO - /home/worker/workspace/build/src/dom/base/nsGlobalWindow.cpp:13633:15: error: expected unqualified-id before 'auto'
[task 2017-03-15T14:48:29.992840Z] 14:48:29 INFO - for (const& auto display : mVRDisplays) {
[task 2017-03-15T14:48:29.992876Z] 14:48:29 INFO - ^
[task 2017-03-15T14:48:29.992954Z] 14:48:29 INFO - /home/worker/workspace/build/src/dom/base/nsGlobalWindow.cpp:13633:15: error: expected ';' before 'auto'
[task 2017-03-15T14:48:29.993093Z] 14:48:29 INFO - /home/worker/workspace/build/src/dom/base/nsGlobalWindow.cpp:13633:15: error: expected primary-expression before 'auto'
[task 2017-03-15T14:48:29.993154Z] 14:48:29 INFO - /home/worker/workspace/build/src/dom/base/nsGlobalWindow.cpp:13633:15: error: expected ';' before 'auto'
[task 2017-03-15T14:48:29.993299Z] 14:48:29 INFO - /home/worker/workspace/build/src/dom/base/nsGlobalWindow.cpp:13633:15: error: expected primary-expression before 'auto'
[task 2017-03-15T14:48:29.993375Z] 14:48:29 INFO - /home/worker/workspace/build/src/dom/base/nsGlobalWindow.cpp:13633:15: error: expected ')' before 'auto'
[task 2017-03-15T14:48:29.993502Z] 14:48:29 INFO - /home/worker/workspace/build/src/dom/base/nsGlobalWindow.cpp:13633:28: error: expected initializer before ':' token
[task 2017-03-15T14:48:29.993543Z] 14:48:29 INFO - for (const& auto display : mVRDisplays) {
[task 2017-03-15T14:48:29.993593Z] 14:48:29 INFO - ^
[task 2017-03-15T14:48:29.993658Z] 14:48:29 INFO - /home/worker/workspace/build/src/dom/base/nsGlobalWindow.cpp:14960:42: error: expected '}' at end of input
[task 2017-03-15T14:48:29.993697Z] 14:48:29 INFO - template class nsPIDOMWindow<nsISupports>;
[task 2017-03-15T14:48:29.993743Z] 14:48:29 INFO - ^
[task 2017-03-15T14:48:29.993791Z] 14:48:29 INFO - /home/worker/workspace/build/src/config/rules.mk:1016: recipe for target 'nsGlobalWindow.o' failed
[task 2017-03-15T14:48:29.993829Z] 14:48:29 INFO - gmake[5]: *** [nsGlobalWindow.o] Error 1
Flags: needinfo?(sledru)
Reporter | ||
Comment 5•8 years ago
|
||
interesting, thanks!
Assignee: nobody → sledru
Flags: needinfo?(sledru)
Reporter | ||
Updated•7 years ago
|
Assignee: sledru → bpostelnicu
Assignee | ||
Comment 6•7 years ago
|
||
It seems that partially the issues are no longer present, I'm gonna look to see if there are other places.
[1] https://dxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindowInner.cpp#6797
[2] https://dxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindowInner.cpp#6841
[3] https://dxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindowInner.cpp#6871
[4] https://dxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindowInner.cpp#6899
[5] https://dxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindowInner.cpp#6927
Assignee | ||
Comment 7•7 years ago
|
||
This bug can now be closed since this file is clean.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•