diff options
author | Julian Andres Klode <jak@debian.org> | 2016-01-07 19:16:23 +0100 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-01-07 19:59:08 +0100 |
commit | eff0c22e59e65b6b63e854ff41eb091278e05714 (patch) | |
tree | 8496b397479c397085bb57dd4756c9113b4e2cbf /apt-pkg/contrib/strutl.h | |
parent | fe7fa47c1141066c89ab3382c318a4b9d00fe249 (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/contrib/strutl.h')
-rw-r--r-- | apt-pkg/contrib/strutl.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index a8bbc38af..c5c8e2382 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -22,6 +22,9 @@ #include <cstring> #include <vector> #include <iostream> +#ifdef APT_PKG_EXPOSE_STRING_VIEW +#include <apt-pkg/string_view.h> +#endif #include <time.h> #include <stddef.h> @@ -75,7 +78,9 @@ bool StrToNum(const char *Str,unsigned long long &Res,unsigned Len,unsigned Base bool Base256ToNum(const char *Str,unsigned long &Res,unsigned int Len); bool Base256ToNum(const char *Str,unsigned long long &Res,unsigned int Len); bool Hex2Num(const std::string &Str,unsigned char *Num,unsigned int Length); - +#ifdef APT_PKG_EXPOSE_STRING_VIEW +APT_HIDDEN bool Hex2Num(const APT::StringView Str,unsigned char *Num,unsigned int Length); +#endif // input changing string split bool TokSplitString(char Tok,char *Input,char **List, unsigned long ListMax); |