summaryrefslogtreecommitdiff
path: root/src/util/regexp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/regexp.cpp')
-rw-r--r--src/util/regexp.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util/regexp.cpp b/src/util/regexp.cpp
index c0e2947cb..62cf2b647 100644
--- a/src/util/regexp.cpp
+++ b/src/util/regexp.cpp
@@ -95,16 +95,16 @@ void String::getCharSet(std::set<unsigned int> &cset) const {
}
}
-bool String::overlap(String &y) const {
- unsigned n = d_str.size() < y.size() ? d_str.size() : y.size();
- for(unsigned i=1; i<n; i++) {
+std::size_t String::overlap(String &y) const {
+ std::size_t i = d_str.size() < y.size() ? d_str.size() : y.size();
+ for(; i>0; i--) {
String s = suffix(i);
String p = y.prefix(i);
if(s == p) {
- return true;
+ return i;
}
}
- return false;
+ return i;
}
std::string String::toString() const {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback