From 5b7d9987642f72d44223a8e5e79e013bb2b3d579 Mon Sep 17 00:00:00 2001 From: Roberto I Date: Tue, 11 Nov 2025 14:40:30 -0300 Subject: External strings are as good as internal ones A '__mode' metafield and an "n" key both can be external strings. --- lgc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lgc.c') diff --git a/lgc.c b/lgc.c index a775b6e5..60f042c7 100644 --- a/lgc.c +++ b/lgc.c @@ -594,10 +594,10 @@ static void traversestrongtable (global_State *g, Table *h) { */ static int getmode (global_State *g, Table *h) { const TValue *mode = gfasttm(g, h->metatable, TM_MODE); - if (mode == NULL || !ttisshrstring(mode)) - return 0; /* ignore non-(short)string modes */ + if (mode == NULL || !ttisstring(mode)) + return 0; /* ignore non-string modes */ else { - const char *smode = getshrstr(tsvalue(mode)); + const char *smode = getstr(tsvalue(mode)); const char *weakkey = strchr(smode, 'k'); const char *weakvalue = strchr(smode, 'v'); return ((weakkey != NULL) << 1) | (weakvalue != NULL); -- cgit v1.2.3-55-g6feb