1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

lib: Move get_iconv_handle() call down

We only need this in the slow path. A good compiler might detect this,
but as get_iconv_handle() might have side-effects from a compiler's
point of view, I'm not sure it's legal to skip the call in the fast
path. Might be premature optimization, but it's low hanging fruit :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Mar 23 21:21:15 CET 2015 on sn-devel-104
This commit is contained in:
Volker Lendecke 2015-03-23 15:03:47 +00:00
parent 8de2164835
commit dee2b958c0

View File

@ -369,7 +369,7 @@ _PUBLIC_ char *strchr_m(const char *src, char c)
*/
_PUBLIC_ char *strrchr_m(const char *s, char c)
{
struct smb_iconv_handle *ic = get_iconv_handle();
struct smb_iconv_handle *ic;
char *ret = NULL;
if (s == NULL) {
@ -416,6 +416,8 @@ _PUBLIC_ char *strrchr_m(const char *s, char c)
return NULL;
}
ic = get_iconv_handle();
while (*s) {
size_t size;
codepoint_t c2 = next_codepoint_handle(ic, s, &size);