|
|
DescriptionCleanup: Initialize Value from tools/gn by moving std::string
Previously it used string::swap, but std::move is more effective in this case.
BUG=367418
TEST=
R=brettw@chromium.org
Committed: https://crrev.com/0b310e43469a5ef54d76661ec36e4a7e1ca09d3f
Cr-Commit-Position: refs/heads/master@{#399012}
Patch Set 1 #
Total comments: 3
Patch Set 2 : Remove Value(..., std::string&&) #
Total comments: 2
Patch Set 3 : Revert tools/gn/value.[cc|h] #Patch Set 4 : Rebase against ToT #Patch Set 5 : Pass by value and then move it #Messages
Total messages: 28 (9 generated)
tfarina@chromium.org changed reviewers: + tfarina@chromium.org
Could you split out this change? testing/ -> phajdan.jr tools/clang -> thakis tools/gn -> brettw Thanks,
ki.stfu@gmail.com changed reviewers: + brettw@chromium.org, phajdan.jr@chromium.org, thakis@chromium.org - darin@chromium.org, jam@chromium.org
phajdan.jr@: please review changed files in testing/ thakis@: please review tools/clang/ brettw@: please review tools/gn
https://codereview.chromium.org/1350043004/diff/1/tools/gn/value.h File tools/gn/value.h (right): https://codereview.chromium.org/1350043004/diff/1/tools/gn/value.h#newcode36 tools/gn/value.h:36: Value(const ParseNode* origin, std::string&& str_val) noexcept; Same comment from the other patch here. This is still technically disallowed by the style guide.
https://codereview.chromium.org/1350043004/diff/1/tools/gn/value.h File tools/gn/value.h (right): https://codereview.chromium.org/1350043004/diff/1/tools/gn/value.h#newcode36 tools/gn/value.h:36: Value(const ParseNode* origin, std::string&& str_val) noexcept; On 2015/09/23 05:29:10, brettw wrote: > Same comment from the other patch here. This is still technically disallowed by > the style guide. Ok, I'll remove std::string&& version.
https://codereview.chromium.org/1350043004/diff/1/tools/gn/value.h File tools/gn/value.h (right): https://codereview.chromium.org/1350043004/diff/1/tools/gn/value.h#newcode36 tools/gn/value.h:36: Value(const ParseNode* origin, std::string&& str_val) noexcept; On 2015/09/23 05:29:10, brettw wrote: > Same comment from the other patch here. This is still technically disallowed by > the style guide. Done.
https://codereview.chromium.org/1350043004/diff/20001/tools/gn/value.h File tools/gn/value.h (right): https://codereview.chromium.org/1350043004/diff/20001/tools/gn/value.h#newcode35 tools/gn/value.h:35: Value(const ParseNode* origin, const std::string& str_val); I think without adding the && constructor, this will be a bad change since it will prevent certain types of optimizations. I suspect we should just revert the change to this file.
https://codereview.chromium.org/1350043004/diff/20001/tools/gn/value.h File tools/gn/value.h (right): https://codereview.chromium.org/1350043004/diff/20001/tools/gn/value.h#newcode35 tools/gn/value.h:35: Value(const ParseNode* origin, const std::string& str_val); On 2015/09/24 20:15:31, brettw wrote: > I think without adding the && constructor, this will be a bad change since it > will prevent certain types of optimizations. I suspect we should just revert the > change to this file. Probably yes. BTW, why we don't want to use a movable version? You said it's disallowed, but actually it's not. It just should be approved by OWNERS of src/styleguide/c++/.
On 2015/09/24 20:54:29, ki.stfu wrote: > Probably yes. BTW, why we don't want to use a movable version? You said it's > disallowed, but actually it's not. It just should be approved by OWNERS of > src/styleguide/c++/. Right, I'm not actually opposed to asking for approval for this. It just seemed less important than the other patch you were doing (where clearly it should use move IMO).
On 2015/09/24 21:41:23, brettw wrote: > On 2015/09/24 20:54:29, ki.stfu wrote: > > Probably yes. BTW, why we don't want to use a movable version? You said it's > > disallowed, but actually it's not. It just should be approved by OWNERS of > > src/styleguide/c++/. > > Right, I'm not actually opposed to asking for approval for this. It just seemed > less important than the other patch you were doing (where clearly it should use > move IMO). OK. I know we can't use movable ctors everywhere.
Description was changed from ========== Cleanup: Pass std::string as const reference from testing/ and tools/ Passing std::string by reference can prevent extra copying of object. BUG=367418 TEST= R=phajdan.jr@chromium.org,thakis@chromium.org,brettw@chromium.org ========== to ========== Cleanup: Pass std::string as const reference from tools/gn/ Passing std::string by reference can prevent extra copying of object. BUG=367418 TEST= R=brettw@chromium.org ==========
ki.stfu@gmail.com changed reviewers: - phajdan.jr@chromium.org, tfarina@chromium.org, thakis@chromium.org
The patch was split: Changes in testing/ were moved to https://codereview.chromium.org/2001093008/ Changes in tools/clang/ were moved to https://codereview.chromium.org/2009293002/
Description was changed from ========== Cleanup: Pass std::string as const reference from tools/gn/ Passing std::string by reference can prevent extra copying of object. BUG=367418 TEST= R=brettw@chromium.org ========== to ========== Cleanup: Initialize Value from tools/gn by moving std::string Previously it used string::swap, but std::move is more effective in this case. BUG=367418 TEST= R=brettw@chromium.org ==========
Friendly ping
ki.stfu@gmail.com changed reviewers: + scottmg@chromium.org, thakis@chromium.org
Friendly ping
I would have made it a const& arg so I think you'll have to wait for brettw on this one.
lgtm
The CQ bit was checked by ki.stfu@gmail.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350043004/80001
Message was sent while issue was closed.
Description was changed from ========== Cleanup: Initialize Value from tools/gn by moving std::string Previously it used string::swap, but std::move is more effective in this case. BUG=367418 TEST= R=brettw@chromium.org ========== to ========== Cleanup: Initialize Value from tools/gn by moving std::string Previously it used string::swap, but std::move is more effective in this case. BUG=367418 TEST= R=brettw@chromium.org ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001)
Message was sent while issue was closed.
CQ bit was unchecked
Message was sent while issue was closed.
Description was changed from ========== Cleanup: Initialize Value from tools/gn by moving std::string Previously it used string::swap, but std::move is more effective in this case. BUG=367418 TEST= R=brettw@chromium.org ========== to ========== Cleanup: Initialize Value from tools/gn by moving std::string Previously it used string::swap, but std::move is more effective in this case. BUG=367418 TEST= R=brettw@chromium.org Committed: https://crrev.com/0b310e43469a5ef54d76661ec36e4a7e1ca09d3f Cr-Commit-Position: refs/heads/master@{#399012} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/0b310e43469a5ef54d76661ec36e4a7e1ca09d3f Cr-Commit-Position: refs/heads/master@{#399012} |