[core] use the more efficient mult-byte tolower/toupper in the helper func

This commit is contained in:
Anthony Minessale 2020-05-28 21:35:00 +00:00 committed by Andrey Volk
parent 4ad2e71f95
commit bb02989f42
1 changed files with 2 additions and 8 deletions

View File

@ -888,13 +888,10 @@ static inline char *switch_safe_strdup(const char *it)
static inline char *switch_lc_strdup(const char *it) static inline char *switch_lc_strdup(const char *it)
{ {
char *dup; char *dup;
char *p;
if (it) { if (it) {
dup = strdup(it); dup = strdup(it);
for (p = dup; p && *p; p++) { switch_tolower_max(dup);
*p = (char) switch_tolower(*p);
}
return dup; return dup;
} }
@ -905,13 +902,10 @@ static inline char *switch_lc_strdup(const char *it)
static inline char *switch_uc_strdup(const char *it) static inline char *switch_uc_strdup(const char *it)
{ {
char *dup; char *dup;
char *p;
if (it) { if (it) {
dup = strdup(it); dup = strdup(it);
for (p = dup; p && *p; p++) { switch_toupper_max(dup);
*p = (char) switch_toupper(*p);
}
return dup; return dup;
} }