From: Julian Andres Klode Date: Fri, 8 Jan 2016 01:32:23 +0000 (+0100) Subject: operator==(char*, StringView) use StringView.operator== X-Git-Tag: 1.2_exp1~21 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/0cc8987abf9f25c458833a0479bc4cb11b405e16 operator==(char*, StringView) use StringView.operator== Use the same path for both comparisons, as the operator== path is faster than just calling compare() - it avoids any comparison if the size differs. Gbp-Dch: ignore --- diff --git a/apt-pkg/contrib/string_view.h b/apt-pkg/contrib/string_view.h index 37a30a6df..5b6411a33 100644 --- a/apt-pkg/contrib/string_view.h +++ b/apt-pkg/contrib/string_view.h @@ -107,6 +107,6 @@ public: } inline bool operator ==(const char *other, APT::StringView that); -inline bool operator ==(const char *other, APT::StringView that) { return that.compare(other) == 0; } +inline bool operator ==(const char *other, APT::StringView that) { return that.operator==(other); } #endif