summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheiterators.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-01-07 19:16:23 +0100
committerJulian Andres Klode <jak@debian.org>2016-01-07 19:59:08 +0100
commiteff0c22e59e65b6b63e854ff41eb091278e05714 (patch)
tree8496b397479c397085bb57dd4756c9113b4e2cbf /apt-pkg/cacheiterators.h
parentfe7fa47c1141066c89ab3382c318a4b9d00fe249 (diff)
Switch performance critical code to use APT::StringView
This improves performance of the cache generation on my ARM platform (4x Cortex A15) by about 10% to 20% from 2.35-2.50 to 2.1 seconds.
Diffstat (limited to 'apt-pkg/cacheiterators.h')
-rw-r--r--apt-pkg/cacheiterators.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index 0647e39f1..75a31a4b3 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -35,6 +35,9 @@
#include<iterator>
#include <iosfwd>
#include <string>
+#ifdef APT_PKG_EXPOSE_STRING_VIEW
+#include <apt-pkg/string_view.h>
+#endif
#include<string.h>
@@ -114,6 +117,10 @@ class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;}
inline PkgIterator PackageList() const;
PkgIterator FindPkg(std::string Arch = "any") const;
+#ifdef APT_PKG_EXPOSE_STRING_VIEW
+ APT_HIDDEN PkgIterator FindPkg(APT::StringView Arch = APT::StringView("any", 3)) const;
+ APT_HIDDEN PkgIterator FindPkg(const char *Arch) const;
+#endif
/** \brief find the package with the "best" architecture
The best architecture is either the "native" or the first