diff --git a/src/util/charreach_util.h b/src/util/charreach_util.h index 47f76a3f..f0dc4227 100644 --- a/src/util/charreach_util.h +++ b/src/util/charreach_util.h @@ -29,43 +29,11 @@ #ifndef CHARREACH_UTIL_H #define CHARREACH_UTIL_H -#include -#include - -#include "charreach.h" +#include "ue2common.h" namespace ue2 { -template -std::map > -make_disjoint(const std::map > &in) { - using namespace std; - - map > by_char; - for (typename map >::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, CharReach> rev; - for (typename map >::const_iterator it = by_char.begin(); - it != by_char.end(); ++it) { - rev[it->second].set(it->first); - } - - map > out; - for (typename map, 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);