Merge lp:~akopytov/percona-server/bug1132350 into lp:percona-server/5.5

Proposed by Alexey Kopytov on 2013-02-24
Status: Merged
Approved by: Laurynas Biveinis on 2013-02-25
Approved revision: 451
Merged at revision: 458
Proposed branch: lp:~akopytov/percona-server/bug1132350
Merge into: lp:percona-server/5.5
Diff against target: 34 lines (+9/-11)
1 file modified
Percona-Server/strings/ctype-simple.c (+9/-11)
To merge this branch: bzr merge lp:~akopytov/percona-server/bug1132350
Reviewer Review Type Date Requested Status
Sergei Glushchenko (community) g2 2013-02-24 Approve on 2013-02-25
Review via email: mp+150229@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/strings/ctype-simple.c'
2--- Percona-Server/strings/ctype-simple.c 2011-06-30 15:46:53 +0000
3+++ Percona-Server/strings/ctype-simple.c 2013-02-24 15:11:22 +0000
4@@ -76,23 +76,21 @@
5 const uchar *src, size_t srclen)
6 {
7 uchar *map= cs->sort_order;
8- size_t dstlen= len;
9- set_if_smaller(len, srclen);
10- if (dest != src)
11+ const uchar *end;
12+
13+ if (likely(len <= srclen))
14 {
15- const uchar *end;
16- for ( end=src+len; src < end ; )
17+ for (end = src + len; src < end ; )
18 *dest++= map[*src++];
19 }
20 else
21 {
22- const uchar *end;
23- for ( end=dest+len; dest < end ; dest++)
24- *dest= (char) map[(uchar) *dest];
25+ for (end = src + srclen; src < end ; )
26+ *dest++= map[*src++];
27+ memset(dest, ' ', len - srclen);
28 }
29- if (dstlen > len)
30- bfill(dest, dstlen - len, ' ');
31- return dstlen;
32+
33+ return len;
34 }
35
36

Subscribers

People subscribed via source and target branches