[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work1) now available
- From: Klaus Ripke <paul-lua@...>
- Date: Tue, 12 Jan 2010 12:34:09 +0100
On Mon, Jan 11, 2010 at 05:36:48PM -0500, Tom N Harris wrote:
> Or just: if (t1[1]==t2[1] && t1[2]==t2[2])
> Slightly slower, but who cares? It's an error message.
true true.
Yet there is no reason to have to different copies of
the string "userdata" in luaT_typenames.
luaT_typenames[LUA_TLIGHTUSERDATA] and luaT_typenames[LUA_TUSERDATA]
should just be the same pointer to allow fast and safe
pointer comparision (and save 9 bytes ;).
$ diff -u ltm.c.orig ltm.c
--- ltm.c.orig 2007-12-27 14:02:25.000000000 +0100
+++ ltm.c 2010-01-12 12:25:54.000000000 +0100
@@ -19,10 +19,10 @@
#include "ltm.h"
-
+static const char userdata[] = "userdata";
const char *const luaT_typenames[] = {
- "nil", "boolean", "userdata", "number",
- "string", "table", "function", "userdata", "thread",
+ "nil", "boolean", userdata, "number",
+ "string", "table", "function", userdata, "thread",
"proto", "upval"
};
best
- References:
- Re: [ANN] Lua 5.2.0 (work1) now available, Alexander Gladysh
- Re: [ANN] Lua 5.2.0 (work1) now available, steve donovan
- Re: [ANN] Lua 5.2.0 (work1) now available, Tom N Harris
- Re: [ANN] Lua 5.2.0 (work1) now available, Nevin Flanagan
- Re: [ANN] Lua 5.2.0 (work1) now available, Tom N Harris
- Re: [ANN] Lua 5.2.0 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.2.0 (work1) now available, Tony Finch
- Re: [ANN] Lua 5.2.0 (work1) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.2.0 (work1) now available, Duboucher Thomas
- Re: [ANN] Lua 5.2.0 (work1) now available, Tom N Harris