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.) --- llex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llex.c') 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) { if (isempty(o)) { /* not in use yet? */ /* boolean value does not need GC barrier; table is not a metatable, so it does not need to invalidate cache */ - setbvalue(o, 1); /* t[string] = true */ + setbtvalue(o); /* t[string] = true */ luaC_checkGC(L); } else { /* string already present */ -- cgit v1.2.3-55-g6feb