Browse Source

Avoid extra inner copy in APT_MKSTRCMP and APT_MKSTRCMP2

Backported from lp:~mvo/apt/debian-experimental
Patch by Eugene V. Lyubimkin
debian/1.8.y
David Kalnischkies 13 years ago
parent
commit
5cbf7810a2
  1. 12
      apt-pkg/contrib/strutl.h
  2. 4
      debian/changelog

12
apt-pkg/contrib/strutl.h

@ -68,15 +68,15 @@ int tolower_ascii(int c);
#define APT_MKSTRCMP(name,func) \
inline int name(const char *A,const char *B) {return func(A,A+strlen(A),B,B+strlen(B));}; \
inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));}; \
inline int name(string A,const char *B) {return func(A.c_str(),A.c_str()+A.length(),B,B+strlen(B));}; \
inline int name(string A,string B) {return func(A.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length());}; \
inline int name(string A,const char *B,const char *BEnd) {return func(A.c_str(),A.c_str()+A.length(),B,BEnd);};
inline int name(const string& A,const char *B) {return func(A.c_str(),A.c_str()+A.length(),B,B+strlen(B));}; \
inline int name(const string& A,const string& B) {return func(A.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length());}; \
inline int name(const string& A,const char *B,const char *BEnd) {return func(A.c_str(),A.c_str()+A.length(),B,BEnd);};
#define APT_MKSTRCMP2(name,func) \
inline int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));}; \
inline int name(string A,const char *B) {return func(A.begin(),A.end(),B,B+strlen(B));}; \
inline int name(string A,string B) {return func(A.begin(),A.end(),B.begin(),B.end());}; \
inline int name(string A,const char *B,const char *BEnd) {return func(A.begin(),A.end(),B,BEnd);};
inline int name(const string& A,const char *B) {return func(A.begin(),A.end(),B,B+strlen(B));}; \
inline int name(const string& A,const string& B) {return func(A.begin(),A.end(),B.begin(),B.end());}; \
inline int name(const string& A,const char *B,const char *BEnd) {return func(A.begin(),A.end(),B,BEnd);};
int stringcmp(const char *A,const char *AEnd,const char *B,const char *BEnd);
int stringcasecmp(const char *A,const char *AEnd,const char *B,const char *BEnd);

4
debian/changelog

@ -32,6 +32,10 @@ apt (0.7.25) UNRELEASED; urgency=low
* methods/connect.cc:
- display also strerror of "wicked" getaddrinfo errors
[ Eugene V. Lyubimkin ]
* apt-pkg/contib/strutl.h
- Avoid extra inner copy in APT_MKSTRCMP and APT_MKSTRCMP2.
[ Julian Andres Klode ]
* doc/apt.conf.5.xml:
- Deprecate unquoted values, string concatenation and explain what should

Loading…
Cancel
Save