SuccessChanges

Summary

  1. [clang-tidy] performance-inefficient-vector-operation: Support proto repeated field Summary: Finds calls that add element to protobuf repeated field in a loop without calling Reserve() before the loop. Calling Reserve() first can avoid unnecessary memory reallocations. A new option EnableProto is added to guard this feature. Patch by Cong Liu! Reviewers: gribozavr, alexfh, hokein, aaron.ballman Reviewed By: hokein Subscribers: lebedev.ri, xazax.hun, Eugene.Zelenko, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D67135
Revision 371963 by hokein:
[clang-tidy] performance-inefficient-vector-operation: Support proto repeated field

Summary:
Finds calls that add element to protobuf repeated field in a loop
without calling Reserve() before the loop. Calling Reserve() first can avoid
unnecessary memory reallocations.

A new option EnableProto is added to guard this feature.

Patch by Cong Liu!

Reviewers: gribozavr, alexfh, hokein, aaron.ballman

Reviewed By: hokein

Subscribers: lebedev.ri, xazax.hun, Eugene.Zelenko, cfe-commits

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D67135
Change TypePath in RepositoryPath in Workspace
The file was modified/clang-tools-extra/trunk/clang-tidy/performance/InefficientVectorOperationCheck.cpp (diff)clang-tools-extra.src/clang-tidy/performance/InefficientVectorOperationCheck.cpp
The file was modified/clang-tools-extra/trunk/clang-tidy/performance/InefficientVectorOperationCheck.h (diff)clang-tools-extra.src/clang-tidy/performance/InefficientVectorOperationCheck.h
The file was modified/clang-tools-extra/trunk/docs/clang-tidy/checks/performance-inefficient-vector-operation.rst (diff)clang-tools-extra.src/docs/clang-tidy/checks/performance-inefficient-vector-operation.rst
The file was modified/clang-tools-extra/trunk/test/clang-tidy/performance-inefficient-vector-operation.cpp (diff)clang-tools-extra.src/test/clang-tidy/performance-inefficient-vector-operation.cpp