1
0

LuaState can push strings with embedded NULs.

This also marginally improves performance, since a strlen() isn't called (inside lua_pushstring()), the string length is stored in the AString object directly.
This commit is contained in:
madmaxoft 2014-01-07 15:55:23 +01:00
parent 748fd86b83
commit bcd41dc1aa

View File

@ -297,7 +297,7 @@ void cLuaState::Push(const AString & a_String)
{
ASSERT(IsValid());
tolua_pushcppstring(m_LuaState, a_String);
lua_pushlstring(m_LuaState, a_String.data(), a_String.size());
m_NumCurrentFunctionArgs += 1;
}