mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Fix clang-tidy performance-inefficient-vector-operation warnings
This commit is contained in:
parent
b8e28abb97
commit
6196950567
4 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,7 @@ Checks: [-*,
|
||||||
performance-enum-size,
|
performance-enum-size,
|
||||||
performance-faster-string-find,
|
performance-faster-string-find,
|
||||||
performance-for-range-copy,
|
performance-for-range-copy,
|
||||||
|
performance-inefficient-vector-operation,
|
||||||
|
|
||||||
# Skipping these temporarily because they are very noisy
|
# Skipping these temporarily because they are very noisy
|
||||||
-bugprone-narrowing-conversions,
|
-bugprone-narrowing-conversions,
|
||||||
|
|
|
@ -678,6 +678,7 @@ void Manager::DoTerminate() {
|
||||||
iosource_mgr->UnregisterFd(bstate->loggerQueue->FlareFd(), this);
|
iosource_mgr->UnregisterFd(bstate->loggerQueue->FlareFd(), this);
|
||||||
|
|
||||||
vector<string> stores_to_close;
|
vector<string> stores_to_close;
|
||||||
|
stores_to_close.reserve(data_stores.size());
|
||||||
|
|
||||||
for ( auto& x : data_stores )
|
for ( auto& x : data_stores )
|
||||||
stores_to_close.push_back(x.first);
|
stores_to_close.push_back(x.first);
|
||||||
|
|
|
@ -1056,6 +1056,8 @@ StmtPtr InitStmt::Duplicate() {
|
||||||
// Need to duplicate the initializer list since later reductions
|
// Need to duplicate the initializer list since later reductions
|
||||||
// can modify it in place.
|
// can modify it in place.
|
||||||
std::vector<IDPtr> new_inits;
|
std::vector<IDPtr> new_inits;
|
||||||
|
new_inits.reserve(inits.size());
|
||||||
|
|
||||||
for ( const auto& id : inits )
|
for ( const auto& id : inits )
|
||||||
new_inits.push_back(id);
|
new_inits.push_back(id);
|
||||||
|
|
||||||
|
|
|
@ -942,6 +942,7 @@ SetupResult setup(int argc, char** argv, Options* zopts) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<SignatureFile> all_signature_files;
|
std::vector<SignatureFile> all_signature_files;
|
||||||
|
all_signature_files.reserve(options.signature_files.size() + zeek::detail::sig_files.size());
|
||||||
|
|
||||||
// Append signature files given on the command line
|
// Append signature files given on the command line
|
||||||
for ( const auto& sf : options.signature_files )
|
for ( const auto& sf : options.signature_files )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue