Enable ClangTidy check performance-for-range-copy.
This will prevent us from writing range-based for loops that copy the loop variable when a const& would suffice. https://clang.llvm.org/extra/clang-tidy/checks/performance-for-range-copy.html ----- Finds C++11 for ranges where the loop variable is copied in each iteration but it would suffice to obtain it by const reference. The check 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. Change-Id: Ic26bff7e9c48b4d1a9ad9c0606199920ea7a0af8 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306945 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
This commit is contained in:
parent
128ed7b4df
commit
bfbe71252a
@ -1 +1 @@
|
||||
Checks: '-*,bugprone-use-after-move,bugprone-unused-raii,bugprone-undelegated-constructor,bugprone-argument-comment,google-build-namespaces'
|
||||
Checks: '-*,bugprone-use-after-move,bugprone-unused-raii,bugprone-undelegated-constructor,bugprone-argument-comment,performance-for-range-copy,google-build-namespaces'
|
||||
|
Loading…
Reference in New Issue
Block a user