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