lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> ... there's no particular reason to use a naive multi-strcmp()
approach.

Sure, the strcmps were just illustrative of the problem. (strncmp + atoi
is supposed to be better than just strcmp?) But the point is I don't
want to even hash the string EVERY time the tag method is invoked. 

Luiz had a pretty decent solution actually. Someone else replied offline
of another idea, which is to rely on the fact that lua_tostring returns
a pointer to Lua's internal string, which means it's always the same,
which means I can effectively treat that as an id. I really like that.
Is that going to break in 4.1?

Thanks,

Curt