diff --git a/simplecpp.cpp b/simplecpp.cpp index c61c3ce1..29a9f32e 100755 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -154,6 +154,9 @@ static unsigned long long stringToULL(const std::string &s) static bool endsWith(const std::string &s, const std::string &e) { + // TODO: std::equal() is much faster than std::string::compare() in a benchmark + // but in our case it leads to a big performance regression + //return (s.size() >= e.size() && s.compare(s.size() - e.size(), e.size(), e) == 0); return (s.size() >= e.size()) && std::equal(e.rbegin(), e.rend(), s.rbegin()); }