Happy to stamp with OO+1 once comments are addressed (or I might be wrong about some of them!)
emplace() in a loop where the change can be accomplished mechanically.Presumably `MakeFlatSet()` is also more efficient, right?
[&](const auto result) { return result->id(); });Does this copy something potentially big?
[&](const auto item) { return item.first; });Same question here.
[](const auto& it) { return std::string_view(it.first); });It'd be nice to add a comment here why string_view won't dangle (though I know the original didn't have it either).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
auto all = base::MakeFlatSet<AcceleratorAction>(drive-by nit: just `return base::MakeFlatSet...`;
also in several other places below
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
emplace() in a loop where the change can be accomplished mechanically.Presumably `MakeFlatSet()` is also more efficient, right?
Good point. I added an explanation of the reason for the change.
drive-by nit: just `return base::MakeFlatSet...`;
also in several other places below
Done
Does this copy something potentially big?
The argument type was copied from the original loop, since there's no consistently right answer. In this case it's a `base::WeakPtr`, so it's not big, but it is wasteful to copy, so I changed it to a reference.
[&](const auto item) { return item.first; });Adam RiceSame question here.
In this case it's a `value_type` for `base::DictValue`, ie. `std::pair<const std::string&, const Value&>`. It shouldn't matter if this is copied or not, but I changed it to a reference to make the code easier to read.
[](const auto& it) { return std::string_view(it.first); });It'd be nice to add a comment here why string_view won't dangle (though I know the original didn't have it either).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Owners-Override | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |