On 14-Oct-04, at 2:39 PM, Tom Spilman wrote:
I was considering hashes, but doesn't Lua internally keep a hashed
version
of the string? Is there a way to get to that? Or can I count on the
const
char pointer returned from lua_tostring to be the same for the same
strings
(this sounds really hacky)? As it is now my innermost scripted loops
are
doing string compares at the binding layer which makes them less
efficient
than they could be with a good hash.
You can count on the char pointer to be the same provided the string
never gets garbage collected. (i.e., if you keep a reference to the
string somewhere.)