From 6dc60370a750334cb701386cfa4ef9719db9078a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Mar 2010 12:38:38 +0200 Subject: replace every call to toupper with one to our own tolower_ascii This sounds like a premature optimization and since Mr. Knuth we all know that they are the root of all evil - but, and here it starts to be interesting: As the tolower_ascii method is by far the most called method we have (~60 Mio. times) and as we compare only strings containing ascii characters (package names, configuration options) using our own method reduces execution time of APT by 4% plus it avoids that the locale settings can influence us. --- apt-pkg/contrib/error.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apt-pkg/contrib/error.h') diff --git a/apt-pkg/contrib/error.h b/apt-pkg/contrib/error.h index 90747ff7e..8d5ec05ea 100644 --- a/apt-pkg/contrib/error.h +++ b/apt-pkg/contrib/error.h @@ -60,13 +60,13 @@ class GlobalError public: // Call to generate an error from a library call. - bool Errno(const char *Function,const char *Description,...) __like_printf_2 __cold; - bool WarningE(const char *Function,const char *Description,...) __like_printf_2 __cold; + bool Errno(const char *Function,const char *Description,...) __like_printf(3) __cold; + bool WarningE(const char *Function,const char *Description,...) __like_printf(3) __cold; /* A warning should be considered less severe than an error, and may be ignored by the client. */ - bool Error(const char *Description,...) __like_printf_1 __cold; - bool Warning(const char *Description,...) __like_printf_1 __cold; + bool Error(const char *Description,...) __like_printf(2) __cold; + bool Warning(const char *Description,...) __like_printf(2) __cold; // Simple accessors inline bool PendingError() {return PendingFlag;}; -- cgit v1.2.3