mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug #14637: trim trailing spaces processes data only byte wise
(From: gkodinov) Use and int * where possible to scan for trailing space in a string instead of always iterating char-by-char. Using the attached benchmark file on a 32 bit Intel Core 2 Duo CPU I've got 43485 ms run with the fix compared to 44373 without it. Backported to 5.6.0 (next-mr-runtime) 6.0-codebase revid: 2476.1362.1
This commit is contained in:
@@ -278,14 +278,11 @@ void my_hash_sort_8bit_bin(CHARSET_INFO *cs __attribute__((unused)),
|
||||
{
|
||||
const uchar *pos = key;
|
||||
|
||||
key+= len;
|
||||
|
||||
/*
|
||||
Remove trailing spaces. We have to do this to be able to compare
|
||||
'A ' and 'A' as identical
|
||||
*/
|
||||
while (key > pos && key[-1] == ' ')
|
||||
key--;
|
||||
key= skip_trailing_space(key, len);
|
||||
|
||||
for (; pos < (uchar*) key ; pos++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user