mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Remove useless code from ToLower function in the string library and also name the shorter alias more appropriately.
This commit is contained in:
parent
ae5d86e7cf
commit
2e3fc1e47e
@ -519,13 +519,11 @@ Buffer StrToLowercaseB(CSStr str)
|
|||||||
Buffer b(size + 1); // + null terminator
|
Buffer b(size + 1); // + null terminator
|
||||||
// Resulted string size
|
// Resulted string size
|
||||||
Uint32 n = 0;
|
Uint32 n = 0;
|
||||||
// Currently processed character
|
|
||||||
SQChar c = 0;
|
|
||||||
// Process characters
|
// Process characters
|
||||||
while ((c = *(str++)) != '\0')
|
while (*str != '\0')
|
||||||
{
|
{
|
||||||
// Convert it and move to the next one
|
// Convert it and move to the next one
|
||||||
b.At(n++) = std::tolower(c);
|
b.At(n++) = std::tolower(*(str++));
|
||||||
}
|
}
|
||||||
// End the resulted string
|
// End the resulted string
|
||||||
b.At(n) = '\0';
|
b.At(n) = '\0';
|
||||||
@ -1196,8 +1194,8 @@ void Register_String(HSQUIRRELVM vm)
|
|||||||
.SquirrelFunc(_SC("Right"), &SqRightStr)
|
.SquirrelFunc(_SC("Right"), &SqRightStr)
|
||||||
.SquirrelFunc(_SC("LeftOffset"), &SqLeftOffsetStr)
|
.SquirrelFunc(_SC("LeftOffset"), &SqLeftOffsetStr)
|
||||||
.SquirrelFunc(_SC("RightOffset"), &SqRightOffsetStr)
|
.SquirrelFunc(_SC("RightOffset"), &SqRightOffsetStr)
|
||||||
.SquirrelFunc(_SC("Lower"), &SqToLowercase)
|
.SquirrelFunc(_SC("ToLower"), &SqToLowercase)
|
||||||
.SquirrelFunc(_SC("Upper"), &SqToUppercase)
|
.SquirrelFunc(_SC("ToUpper"), &SqToUppercase)
|
||||||
.SquirrelFunc(_SC("Lowercase"), &SqToLowercase)
|
.SquirrelFunc(_SC("Lowercase"), &SqToLowercase)
|
||||||
.SquirrelFunc(_SC("Uppercase"), &SqToUppercase)
|
.SquirrelFunc(_SC("Uppercase"), &SqToUppercase)
|
||||||
.SquirrelFunc(_SC("AreAllSpace"), &StrCType< CharClassSpec< CharClass::IsSpace > >::AllChars)
|
.SquirrelFunc(_SC("AreAllSpace"), &StrCType< CharClassSpec< CharClass::IsSpace > >::AllChars)
|
||||||
|
Loading…
Reference in New Issue
Block a user