mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
util: switch from Boost to std::unordered set/map
This commit replaces the ue2::unordered_{set,map} types with their STL versions, with some new hashing utilities in util/hash.h. The new types ue2_unordered_set<T> and ue2_unordered_map<Key, T> default to using the ue2_hasher. The header util/ue2_containers.h has been removed, and the flat_set/map containers moved to util/flat_containers.h.
This commit is contained in:
committed by
Matthew Barr
parent
a425bb9b7c
commit
9cf66b6ac9
@@ -48,7 +48,6 @@
|
||||
#include "util/math.h"
|
||||
#include "util/noncopyable.h"
|
||||
#include "util/target_info.h"
|
||||
#include "util/ue2_containers.h"
|
||||
#include "util/ue2string.h"
|
||||
#include "util/verify_types.h"
|
||||
|
||||
@@ -64,6 +63,8 @@
|
||||
#include <numeric>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/multi_array.hpp>
|
||||
@@ -459,7 +460,7 @@ bool getMultiEntriesAtPosition(const FDREngineDescription &eng,
|
||||
const vector<LiteralIndex> &vl,
|
||||
const vector<hwlmLiteral> &lits,
|
||||
SuffixPositionInString pos,
|
||||
std::map<u32, ue2::unordered_set<u32> > &m2) {
|
||||
map<u32, unordered_set<u32>> &m2) {
|
||||
assert(eng.bits < 32);
|
||||
|
||||
u32 distance = 0;
|
||||
@@ -530,7 +531,7 @@ void FDRCompiler::setupTab() {
|
||||
SuffixPositionInString pLimit = eng.getBucketWidth(b);
|
||||
for (SuffixPositionInString pos = 0; pos < pLimit; pos++) {
|
||||
u32 bit = eng.getSchemeBit(b, pos);
|
||||
map<u32, ue2::unordered_set<u32>> m2;
|
||||
map<u32, unordered_set<u32>> m2;
|
||||
bool done = getMultiEntriesAtPosition(eng, vl, lits, pos, m2);
|
||||
if (done) {
|
||||
clearbit(&defaultMask[0], bit);
|
||||
@@ -538,7 +539,7 @@ void FDRCompiler::setupTab() {
|
||||
}
|
||||
for (const auto &elem : m2) {
|
||||
u32 dc = elem.first;
|
||||
const ue2::unordered_set<u32> &mskSet = elem.second;
|
||||
const unordered_set<u32> &mskSet = elem.second;
|
||||
u32 v = ~dc;
|
||||
do {
|
||||
u32 b2 = v & dc;
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#define FDR_ENGINE_DESCRIPTION_H
|
||||
|
||||
#include "engine_description.h"
|
||||
#include "util/ue2_containers.h"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
@@ -49,6 +49,7 @@
|
||||
#include "util/make_unique.h"
|
||||
#include "util/noncopyable.h"
|
||||
#include "util/popcount.h"
|
||||
#include "util/small_vector.h"
|
||||
#include "util/target_info.h"
|
||||
#include "util/verify_types.h"
|
||||
|
||||
|
Reference in New Issue
Block a user