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 <cand@gmx.com>
This commit is contained in:
Lauri Kasanen 2015-11-02 21:18:03 +01:00 коммит произвёл Daniel Stenberg
Родитель 3f7b1bb89f
Коммит 3bd7f28000
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -28,6 +28,10 @@
its behavior is altered by the current locale. */ its behavior is altered by the current locale. */
char Curl_raw_toupper(char in) char Curl_raw_toupper(char in)
{ {
#if !defined(CURL_DOES_CONVERSIONS)
if(in >= 'a' && in <= 'z')
return (char)('A' + in - 'a');
#else
switch (in) { switch (in) {
case 'a': case 'a':
return 'A'; return 'A';
@ -82,6 +86,8 @@ char Curl_raw_toupper(char in)
case 'z': case 'z':
return 'Z'; return 'Z';
} }
#endif
return in; return in;
} }