aboutsummaryrefslogtreecommitdiff
path: root/llex.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 /llex.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 'llex.c')
-rw-r--r--llex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/llex.c b/llex.c
index f88057fe..90a7951f 100644
--- a/llex.c
+++ b/llex.c
@@ -136,7 +136,7 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
136 if (isempty(o)) { /* not in use yet? */ 136 if (isempty(o)) { /* not in use yet? */
137 /* boolean value does not need GC barrier; 137 /* boolean value does not need GC barrier;
138 table is not a metatable, so it does not need to invalidate cache */ 138 table is not a metatable, so it does not need to invalidate cache */
139 setbvalue(o, 1); /* t[string] = true */ 139 setbtvalue(o); /* t[string] = true */
140 luaC_checkGC(L); 140 luaC_checkGC(L);
141 } 141 }
142 else { /* string already present */ 142 else { /* string already present */