]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/regex.cpp
Remove deprecated things
[libs/core.git] / source / strings / regex.cpp
index 60b8ed10294aa1e83b399cb3605a3ef9750b597b..68cf374dcd2544064e45ce661ddb01768f962f1d 100644 (file)
@@ -10,7 +10,7 @@ namespace {
 
 /** Writes an integer to a Regex code string, in little-endian order. */
 template<typename T>
-void write_int(T n, Msp::Regex::Code &code)
+void write_int(T n, basic_string<unsigned char> &code)
 {
        for(unsigned i=0; i<sizeof(T); ++i)
                code += (n>>(i*8))&0xFF;
@@ -18,7 +18,7 @@ void write_int(T n, Msp::Regex::Code &code)
 
 /** Reads an integer from a Regex code string, in little-endian order. */
 template<typename T>
-T read_int(Msp::Regex::Code::const_iterator &c)
+T read_int(basic_string<unsigned char>::const_iterator &c)
 {
        T result = 0;
        for(unsigned i=0; i<sizeof(T); ++i)
@@ -310,7 +310,7 @@ Regex::Code Regex::parse_brackets(const string &str, string::const_iterator &ite
        unsigned char mask[32] = {0};
        unsigned type = 0;
        bool range = false;
-       unsigned char first=0, last = 0;
+       unsigned char first = 0, last = 0;
        for(string::const_iterator i=iter; i!=end; ++i)
        {
                unsigned char c = *i;
@@ -513,7 +513,7 @@ bool Regex::group_compare(const RegMatch::Group &g1, const RegMatch::Group &g2)
        // Earlier match is better
        if(g1.begin<g2.begin)
                return true;
-       if(g2.begin>g2.begin)
+       if(g1.begin>g2.begin)
                return false;
 
        // Longer match at same position is better