Re: Using Lua's string interning for faster compares?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Using Lua's string interning for faster compares?
- From: HyperHacker <hyperhacker@...>
- Date: 2012年1月17日 03:29:47 -0700
On Tue, Jan 17, 2012 at 03:01, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> However, you could call something like const char *lua_intern(L, const
>> char *str); which would intern your string and return the internal
>> pointer which you could then use for comparison.
>
> lua_tostring and lua_tolstring do exactly that.
>
So we can rely on this behaviour and safely compare the pointer
instead of the string itself?
--
Sent from my toaster.