Commit f628fa1c authored by Eric Wong's avatar Eric Wong

optimize away a boatload of strdups during update

git-svn-id: https://svn.musicpd.org/mpd/trunk@3718 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent f8597ccf
......@@ -42,10 +42,17 @@ mpd_sint8 char_conv_latin1ToUtf8 = 0;
#define BUFFER_SIZE 1024
int setCharSetConversion(char * to, char * from) {
if(char_conv_to && strcmp(to,char_conv_to)==0 &&
char_conv_from && strcmp(from,char_conv_from)==0)
{
if(char_conv_to && char_conv_from) {
if (strcmp(from,char_conv_to)==0 &&
strcmp(to,char_conv_from)==0) {
char * swap = char_conv_from;
char_conv_from = char_conv_to;
char_conv_to = swap;
return 0;
} else if (strcmp(to,char_conv_to)==0 &&
strcmp(from,char_conv_from)==0) {
return 0;
}
}
closeCharSetConversion();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment