From 0476d60007ec6693fd9643f6c92aa3adb9fde8d7 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 24 Apr 2023 17:44:05 -0300 Subject: Smaller encoding for charsets in code --- lpvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lpvm.c') diff --git a/lpvm.c b/lpvm.c index f0bb1e7..14e7270 100644 --- a/lpvm.c +++ b/lpvm.c @@ -24,12 +24,12 @@ static const Instruction giveup = {{IGiveup, 0, {0}}}; int charinset (const Instruction *i, const byte *buff, unsigned int c) { - c -= (unsigned int)i->i.aux2.set.offset; + c -= i->i.aux2.set.offset; if (c >= ((unsigned int)i->i.aux2.set.size /* size in instructions... */ * (unsigned int)sizeof(Instruction) /* in bytes... */ * 8u)) /* in bits */ - return i->i.aux1; /* out of range */ - return (testchar(buff, c) != i->i.aux1); + return i->i.aux1; /* out of range; return default value */ + return testchar(buff, c); } -- cgit v1.2.3-55-g6feb