Quellcode durchsuchen

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
Julian Andres Klode vor 10 Jahren
Ursprung
Commit
0cc8987abf
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      apt-pkg/contrib/string_view.h

+ 1 - 1
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