diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-04-24 17:44:05 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-04-24 17:44:05 -0300 |
commit | 0476d60007ec6693fd9643f6c92aa3adb9fde8d7 (patch) | |
tree | 7f2e00409650eecd2f64dd76b82b3f9387be6927 /lpvm.c | |
parent | f8e9bc1c721a0802b2260f48ced72c7e04d7b1ef (diff) | |
download | lpeg-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -24,12 +24,12 @@ static const Instruction giveup = {{IGiveup, 0, {0}}}; | |||
24 | 24 | ||
25 | 25 | ||
26 | int charinset (const Instruction *i, const byte *buff, unsigned int c) { | 26 | int 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 | ||