mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-10-01 03:57:43 +03:00
last batch
This commit is contained in:
@@ -358,9 +358,11 @@ public:
|
||||
// Return the number of bytes scanned
|
||||
size_t bytes() const {
|
||||
size_t sum = 0;
|
||||
for (const auto &packet : packets) {
|
||||
sum += packet.size();
|
||||
}
|
||||
auto packs = [](size_t z, const string &packet) { return z + packet.size(); };
|
||||
sum += std::accumulate(packets.begin(), packets.end(), 0, packs);
|
||||
// for (const auto &packet : packets) {
|
||||
// sum += packet.size();
|
||||
// }
|
||||
return sum;
|
||||
}
|
||||
|
||||
@@ -461,6 +463,7 @@ public:
|
||||
vector<const char *> cstrPatterns;
|
||||
cstrPatterns.reserve(patterns.size());
|
||||
for (const auto &pattern : patterns) {
|
||||
// cppcheck-suppress useStlAlgorithm
|
||||
cstrPatterns.push_back(pattern.c_str());
|
||||
}
|
||||
|
||||
|
@@ -55,6 +55,7 @@
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
@@ -250,9 +251,8 @@ public:
|
||||
// Return the number of bytes scanned
|
||||
size_t bytes() const {
|
||||
size_t sum = 0;
|
||||
for (const auto &packet : packets) {
|
||||
sum += packet.size();
|
||||
}
|
||||
auto packs = [](size_t z, const string &packet) { return z + packet.size(); };
|
||||
sum += std::accumulate(packets.begin(), packets.end(), 0, packs);
|
||||
return sum;
|
||||
}
|
||||
|
||||
@@ -433,6 +433,7 @@ static void databasesFromFile(const char *filename,
|
||||
// storage.)
|
||||
vector<const char*> cstrPatterns;
|
||||
for (const auto &pattern : patterns) {
|
||||
// cppcheck-suppress useStlAlgorithm
|
||||
cstrPatterns.push_back(pattern.c_str());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user