aboutsummaryrefslogtreecommitdiff
path: root/ldump.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-01-06 11:38:31 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-01-06 11:38:31 -0300
commit5ff408d2189c6c24fdf8908db4a31432bbdd6f15 (patch)
treebcd83d7547dab0d5418116eb10f9c601f2f2d3b9 /ldump.c
parente3c83835e7b396ab7db538fb3b052f02d7807dee (diff)
downloadlua-5ff408d2189c6c24fdf8908db4a31432bbdd6f15.tar.gz
lua-5ff408d2189c6c24fdf8908db4a31432bbdd6f15.tar.bz2
lua-5ff408d2189c6c24fdf8908db4a31432bbdd6f15.zip
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.)
Diffstat (limited to 'ldump.c')
-rw-r--r--ldump.c5
1 files changed, 1 insertions, 4 deletions
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) {
113 const TValue *o = &f->k[i]; 113 const TValue *o = &f->k[i];
114 DumpByte(ttypetag(o), D); 114 DumpByte(ttypetag(o), D);
115 switch (ttypetag(o)) { 115 switch (ttypetag(o)) {
116 case LUA_TNIL: 116 case LUA_TNIL: case LUA_TFALSE: case LUA_TTRUE:
117 break;
118 case LUA_TBOOLEAN:
119 DumpByte(bvalue(o), D);
120 break; 117 break;
121 case LUA_TNUMFLT: 118 case LUA_TNUMFLT:
122 DumpNumber(fltvalue(o), D); 119 DumpNumber(fltvalue(o), D);