mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Add Short-String Optimization to plString
This commit is contained in:
@ -115,7 +115,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtGetClientName, args, "Params: avatarKey=None\n
|
||||
PYTHON_RETURN_ERROR;
|
||||
}
|
||||
pyKey* key = pyKey::ConvertFrom(keyObj);
|
||||
return PyString_FromString(cyMisc::GetClientName(*key).s_str());
|
||||
return PyString_FromString(cyMisc::GetClientName(*key).c_str());
|
||||
}
|
||||
else
|
||||
return PyString_FromString(cyMisc::GetLocalClientName().c_str());
|
||||
|
@ -379,7 +379,8 @@ public:
|
||||
char *buffer = new char[count];
|
||||
stream->ReadLE(count, buffer);
|
||||
buffer[count-1] = 0;
|
||||
fString = plString::Steal(buffer, count);
|
||||
fString = plString::FromUtf8(buffer, count);
|
||||
delete [] buffer;
|
||||
}
|
||||
else
|
||||
fString = plString::Null;
|
||||
@ -433,8 +434,7 @@ public:
|
||||
else
|
||||
count = 0;
|
||||
stream->WriteLE(count);
|
||||
if ( count != 0 )
|
||||
stream->WriteLE(count, fString.c_str());
|
||||
stream->WriteLE(count, fString.c_str());
|
||||
break;
|
||||
|
||||
case kSceneObject:
|
||||
|
@ -607,7 +607,7 @@ const plPythonSDLModifier* plPythonSDLModifier::FindAgeSDL()
|
||||
return sdlMod;
|
||||
|
||||
plNetClientApp::StaticErrorMsg("pfmod %s has a nil python SDL modifier for age sdl %s",
|
||||
pfmod->GetKeyName().s_str("?"), ageName);
|
||||
pfmod->GetKeyName().c_str("?"), ageName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -616,11 +616,11 @@ const plPythonSDLModifier* plPythonSDLModifier::FindAgeSDL()
|
||||
else
|
||||
if (!key->ObjectIsLoaded())
|
||||
plNetClientApp::StaticErrorMsg("key %s not loaded for age sdl %s",
|
||||
key->GetName().s_str("?"), ageName);
|
||||
key->GetName().c_str("?"), ageName);
|
||||
else
|
||||
if (!plPythonFileMod::ConvertNoRef(key->ObjectIsLoaded()))
|
||||
plNetClientApp::StaticErrorMsg("key %s is not a python file mod for age sdl %s",
|
||||
key->GetName().s_str("?"), ageName);
|
||||
key->GetName().c_str("?"), ageName);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user