From 3bd7f2800063ce0ec9452d74c071bfd5d3367bff Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Mon, 2 Nov 2015 21:18:03 +0100 Subject: rawstr: Speed up Curl_raw_toupper by 40% Rationale: when starting up a curl-using app, all cookies from the jar are checked against each other. This was causing a startup delay in the Fifth browser. All tests pass. Signed-off-by: Lauri Kasanen --- lib/rawstr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/rawstr.c') diff --git a/lib/rawstr.c b/lib/rawstr.c index e27dac4a8..31633b9fa 100644 --- a/lib/rawstr.c +++ b/lib/rawstr.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -28,6 +28,10 @@ its behavior is altered by the current locale. */ char Curl_raw_toupper(char in) { +#if !defined(CURL_DOES_CONVERSIONS) + if(in >= 'a' && in <= 'z') + return (char)('A' + in - 'a'); +#else switch (in) { case 'a': return 'A'; @@ -82,6 +86,8 @@ char Curl_raw_toupper(char in) case 'z': return 'Z'; } +#endif + return in; } -- cgit v1.2.3