commit | 0e65a41d08609c5338aab3babbefdc2de038ffe4 | [log] [tgz] |
---|---|---|
author | Mark Mentovai <mark@chromium.org> | Wed Apr 01 17:03:20 2020 -0400 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Jan 19 06:49:41 2021 -0800 |
tree | 39f6311adc720b0fe9d05ea888ceb48d8a429289 | |
parent | 6b5e3ee97a19011d1f805c18f917c362d94d92bf [diff] |
Change for loops to use const references where they did not previously From cl/304219049: Optimize C++11 range-based for loops where the variable is copied in each iteration but it would suffice to obtain it by const reference. This is only applied to loop variables of types that are expensive to copy which means they are not trivially copyable or have a non-trivial copy constructor or destructor. To ensure that it is safe to replace the copy with a const reference, the following heuristic is employed: - The loop variable is const qualified. - The loop variable is not const, but only const methods or operators are invoked on it, or it is used as const reference or value argument in constructors or function calls. Change-Id: Ia91f03740bb57cabc3cad461f4d43cd8f1df8117 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2132844 Reviewed-by: Joshua Peraza <jperaza@chromium.org> Commit-Queue: Mark Mentovai <mark@chromium.org> GitOrigin-RevId: 194e23910c13a68097f7dc7d058fdecd5ebd0b08
Crashpad is a crash-reporting system.
Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.