From 5ff408d2189c6c24fdf8908db4a31432bbdd6f15 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 6 Jan 2020 11:38:31 -0300 Subject: Changed internal representation of booleans Instead of an explicit value (field 'b'), true and false use different tag variants. This avoids reading an extra field and results in more direct code. (Most code that uses booleans needs to distinguish between true and false anyway.) --- ldump.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'ldump.c') diff --git a/ldump.c b/ldump.c index 9b501729..93cadbcc 100644 --- a/ldump.c +++ b/ldump.c @@ -113,10 +113,7 @@ static void DumpConstants (const Proto *f, DumpState *D) { const TValue *o = &f->k[i]; DumpByte(ttypetag(o), D); switch (ttypetag(o)) { - case LUA_TNIL: - break; - case LUA_TBOOLEAN: - DumpByte(bvalue(o), D); + case LUA_TNIL: case LUA_TFALSE: case LUA_TTRUE: break; case LUA_TNUMFLT: DumpNumber(fltvalue(o), D); -- cgit v1.2.3-55-g6feb