diff --git a/CHANGELOG.md b/CHANGELOG.md index 174bc62b..7571fd33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ Version 68: * Split common tests to a new project +* Small speed up in fields comparisons API Changes: diff --git a/include/beast/http/fields.hpp b/include/beast/http/fields.hpp index 1d5d87be..b2167085 100644 --- a/include/beast/http/fields.hpp +++ b/include/beast/http/fields.hpp @@ -104,6 +104,10 @@ public: bool operator()(String const& lhs, value_type const& rhs) const { + if(lhs.size() < rhs.name_string().size()) + return true; + if(lhs.size() > rhs.name_string().size()) + return false; return iless::operator()(lhs, rhs.name_string()); } @@ -112,6 +116,10 @@ public: bool operator()(value_type const& lhs, String const& rhs) const { + if(lhs.name_string().size() < rhs.size()) + return true; + if(lhs.name_string().size() > rhs.size()) + return false; return iless::operator()(lhs.name_string(), rhs); } @@ -119,6 +127,10 @@ public: bool operator()(value_type const& lhs, value_type const& rhs) const { + if(lhs.name_string().size() < rhs.name_string().size()) + return true; + if(lhs.name_string().size() > rhs.name_string().size()) + return false; return iless::operator()(lhs.name_string(), rhs.name_string()); } };