]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/regex.cpp
Remove deprecated things
[libs/core.git] / source / strings / regex.cpp
index 67157c9b185e434adf995ec75eeb3f122869ea9a..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)
@@ -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