]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
make_disjoint: Remove dead code
authorJustin Viiret <justin.viiret@intel.com>
Mon, 14 Dec 2015 23:10:59 +0000 (10:10 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 1 Mar 2016 00:17:28 +0000 (11:17 +1100)
src/util/charreach_util.h

index 47f76a3f3b7f6ba19c38f6b9c7bef0895755cb0d..f0dc4227b01b6f702e154d5768dbb6bec8f0d643 100644 (file)
 #ifndef CHARREACH_UTIL_H
 #define CHARREACH_UTIL_H
 
-#include <map>
-#include <set>
-
-#include "charreach.h"
+#include "ue2common.h"
 
 namespace ue2 {
 
-template<typename T>
-std::map<CharReach, std::set<T> >
-make_disjoint(const std::map<CharReach, std::set<T> > &in) {
-    using namespace std;
-
-    map<u8, set<T> > by_char;
-    for (typename map<CharReach, set<T> >::const_iterator it = in.begin();
-         it != in.end(); ++it) {
-        const CharReach &cr = it->first;
-        for (size_t j = cr.find_first(); j != CharReach::npos;
-             j = cr.find_next(j)) {
-            by_char[j].insert(it->second.begin(), it->second.end());
-        }
-    }
-
-    map<set<T>, CharReach> rev;
-    for (typename map<u8, set<T> >::const_iterator it = by_char.begin();
-         it != by_char.end(); ++it) {
-        rev[it->second].set(it->first);
-    }
-
-    map<CharReach, set<T> > out;
-    for (typename map<set<T>, CharReach>::const_iterator it = rev.begin();
-         it != rev.end(); ++it) {
-        assert(out.find(it->second) == out.end());
-        out[it->second] = it->first;
-    }
-
-    return out;
-}
+class CharReach;
 
 void make_caseless(CharReach *cr);