diff options
author | unknown <knielsen@knielsen-hq.org> | 2012-03-22 13:21:15 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2012-03-22 13:21:15 +0100 |
commit | 8e0afbd8af846073e00271aa4721b066e6cfb112 (patch) | |
tree | 7367e549bd2dd7a63bdd3d0987100427c51790d5 /strings | |
parent | 5338a28912589f1169b66b880a489ec5636bcd83 (diff) | |
download | mariadb-git-8e0afbd8af846073e00271aa4721b066e6cfb112.tar.gz |
Backport some simple performance patches from 5.5.
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-simple.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index f962b4f77cf..93439fa4c8e 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -307,6 +307,7 @@ void my_hash_sort_simple(CHARSET_INFO *cs, { register const uchar *sort_order=cs->sort_order; const uchar *end= key + len; + ulong n1, n2; /* Remove end space. We have to do this to be able to compare @@ -314,13 +315,17 @@ void my_hash_sort_simple(CHARSET_INFO *cs, */ while (end > key && end[-1] == ' ') end--; - + + n1= *nr1; + n2= *nr2; for (; key < (uchar*) end ; key++) { - nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * - ((uint) sort_order[(uint) *key])) + (nr1[0] << 8); - nr2[0]+=3; + n1^=(ulong) ((((uint) n1 & 63)+n2) * + ((uint) sort_order[(uint) *key])) + (n1 << 8); + n2+=3; } + *nr1= n1; + *nr2= n2; } |