зеркало из https://github.com/mozilla/pjs.git
performance tweak in trim
This commit is contained in:
Родитель
1aa3c273b2
Коммит
59e5ef7b52
|
@ -1118,8 +1118,13 @@ nsString& nsString::Trim(const char* aTrimSet,
|
|||
|
||||
//now rewrite your string without unwanted
|
||||
//leading or trailing characters.
|
||||
while (from <= end) {
|
||||
*to++ = *from++;
|
||||
if (from != to) {
|
||||
while (from <= end) {
|
||||
*to++ = *from++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
to = ++end;
|
||||
}
|
||||
|
||||
*to = '\0';
|
||||
|
|
|
@ -1118,8 +1118,13 @@ nsString& nsString::Trim(const char* aTrimSet,
|
|||
|
||||
//now rewrite your string without unwanted
|
||||
//leading or trailing characters.
|
||||
while (from <= end) {
|
||||
*to++ = *from++;
|
||||
if (from != to) {
|
||||
while (from <= end) {
|
||||
*to++ = *from++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
to = ++end;
|
||||
}
|
||||
|
||||
*to = '\0';
|
||||
|
|
|
@ -1118,8 +1118,13 @@ nsString& nsString::Trim(const char* aTrimSet,
|
|||
|
||||
//now rewrite your string without unwanted
|
||||
//leading or trailing characters.
|
||||
while (from <= end) {
|
||||
*to++ = *from++;
|
||||
if (from != to) {
|
||||
while (from <= end) {
|
||||
*to++ = *from++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
to = ++end;
|
||||
}
|
||||
|
||||
*to = '\0';
|
||||
|
|
|
@ -1118,8 +1118,13 @@ nsString& nsString::Trim(const char* aTrimSet,
|
|||
|
||||
//now rewrite your string without unwanted
|
||||
//leading or trailing characters.
|
||||
while (from <= end) {
|
||||
*to++ = *from++;
|
||||
if (from != to) {
|
||||
while (from <= end) {
|
||||
*to++ = *from++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
to = ++end;
|
||||
}
|
||||
|
||||
*to = '\0';
|
||||
|
|
Загрузка…
Ссылка в новой задаче