[core] use the more efficient mult-byte tolower/toupper in the helper func
This commit is contained in:
parent
4ad2e71f95
commit
bb02989f42
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue