summaryrefslogtreecommitdiff
path: root/lundump.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 /lundump.c
parente3c83835e7b396ab7db538fb3b052f02d7807dee (diff)
downloadlua-github-5ff408d2189c6c24fdf8908db4a31432bbdd6f15.tar.gz
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 'lundump.c')
-rw-r--r--lundump.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lundump.c b/lundump.c
index 8f2a490c..45e0b637 100644
--- a/lundump.c
+++ b/lundump.c
@@ -160,8 +160,11 @@ static void LoadConstants (LoadState *S, Proto *f) {
case LUA_TNIL:
setnilvalue(o);
break;
- case LUA_TBOOLEAN:
- setbvalue(o, LoadByte(S));
+ case LUA_TFALSE:
+ setbfvalue(o);
+ break;
+ case LUA_TTRUE:
+ setbtvalue(o);
break;
case LUA_TNUMFLT:
setfltvalue(o, LoadNumber(S));