summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2004-10-21 19:17:04 +0500
committerunknown <bar@mysql.com>2004-10-21 19:17:04 +0500
commit0da47eae2491b53af11f0e06226de3d0052fc28a (patch)
tree0554947b335fca6a85c65584ff7b43027b790133 /strings
parent5f8337fcae2e090d4c6f257cebce37481558771b (diff)
downloadmariadb-git-0da47eae2491b53af11f0e06226de3d0052fc28a.tar.gz
ctype-uca.c:
Optimization: move "space padding" code outside the loop strings/ctype-uca.c: Optimization: move "space padding" code outside the loop
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-uca.c55
1 files changed, 27 insertions, 28 deletions
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 4763a7b7e1b..91af7af0c54 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -7099,38 +7099,37 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs,
{
s_res= scanner_handler->next(&sscanner);
t_res= scanner_handler->next(&tscanner);
+ } while ( s_res == t_res && s_res >0);
- if (s_res > 0 && t_res < 0)
- {
- /* Calculate weight for SPACE character */
- t_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]];
+ if (s_res > 0 && t_res < 0)
+ {
+ /* Calculate weight for SPACE character */
+ t_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]];
- /* compare the first string to spaces */
- do
- {
- if (s_res != t_res)
- return (s_res - t_res);
- s_res= scanner_handler->next(&sscanner);
- } while (s_res > 0);
- return 0;
- }
-
- if (s_res < 0 && t_res > 0)
+ /* compare the first string to spaces */
+ do
{
- /* Calculate weight for SPACE character */
- s_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]];
-
- /* compare the second string to spaces */
- do
- {
- if (s_res != t_res)
- return (s_res - t_res);
- t_res= scanner_handler->next(&tscanner);
- } while (t_res > 0);
- return 0;
- }
+ if (s_res != t_res)
+ return (s_res - t_res);
+ s_res= scanner_handler->next(&sscanner);
+ } while (s_res > 0);
+ return 0;
+ }
- } while ( s_res == t_res && s_res >0);
+ if (s_res < 0 && t_res > 0)
+ {
+ /* Calculate weight for SPACE character */
+ s_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]];
+
+ /* compare the second string to spaces */
+ do
+ {
+ if (s_res != t_res)
+ return (s_res - t_res);
+ t_res= scanner_handler->next(&tscanner);
+ } while (t_res > 0);
+ return 0;
+ }
return ( s_res - t_res );
}