]> git.saurik.com Git - apt.git/commitdiff
operator==(char*, StringView) use StringView.operator==
authorJulian Andres Klode <jak@debian.org>
Fri, 8 Jan 2016 01:32:23 +0000 (02:32 +0100)
committerJulian Andres Klode <jak@debian.org>
Fri, 8 Jan 2016 01:33:36 +0000 (02:33 +0100)
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

apt-pkg/contrib/string_view.h

index 37a30a6dffcd32d225920ce1aaf6d724c6518374..5b6411a3338cf2b7cb29299e73726c510bbe571f 100644 (file)
@@ -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