aboutsummaryrefslogtreecommitdiff
path: root/lpvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-04-24 17:44:05 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-04-24 17:44:05 -0300
commit0476d60007ec6693fd9643f6c92aa3adb9fde8d7 (patch)
tree7f2e00409650eecd2f64dd76b82b3f9387be6927 /lpvm.c
parentf8e9bc1c721a0802b2260f48ced72c7e04d7b1ef (diff)
downloadlpeg-0476d60007ec6693fd9643f6c92aa3adb9fde8d7.tar.gz
lpeg-0476d60007ec6693fd9643f6c92aa3adb9fde8d7.tar.bz2
lpeg-0476d60007ec6693fd9643f6c92aa3adb9fde8d7.zip
Smaller encoding for charsets in code
Diffstat (limited to 'lpvm.c')
-rw-r--r--lpvm.c6
1 files changed, 3 insertions, 3 deletions
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}}};
24 24
25 25
26int charinset (const Instruction *i, const byte *buff, unsigned int c) { 26int charinset (const Instruction *i, const byte *buff, unsigned int c) {
27 c -= (unsigned int)i->i.aux2.set.offset; 27 c -= i->i.aux2.set.offset;
28 if (c >= ((unsigned int)i->i.aux2.set.size /* size in instructions... */ 28 if (c >= ((unsigned int)i->i.aux2.set.size /* size in instructions... */
29 * (unsigned int)sizeof(Instruction) /* in bytes... */ 29 * (unsigned int)sizeof(Instruction) /* in bytes... */
30 * 8u)) /* in bits */ 30 * 8u)) /* in bits */
31 return i->i.aux1; /* out of range */ 31 return i->i.aux1; /* out of range; return default value */
32 return (testchar(buff, c) != i->i.aux1); 32 return testchar(buff, c);
33} 33}
34 34
35 35