Show More
@@ -55,7 +55,7 b' enum dir_state {' | |||||
55 | DDEFAULT, |
|
55 | DDEFAULT, | |
56 | }; |
|
56 | }; | |
57 |
|
57 | |||
58 |
static inline int i |
|
58 | static inline int inset(const uint32_t bitset[], char c) | |
59 | { |
|
59 | { | |
60 | return bitset[((uint8_t)c) >> 5] & (1 << (((uint8_t)c) & 31)); |
|
60 | return bitset[((uint8_t)c) >> 5] & (1 << (((uint8_t)c) & 31)); | |
61 | } |
|
61 | } | |
@@ -419,7 +419,7 b' static Py_ssize_t _encode(const uint32_t' | |||||
419 | } |
|
419 | } | |
420 | break; |
|
420 | break; | |
421 | case DEFAULT: |
|
421 | case DEFAULT: | |
422 |
while (i |
|
422 | while (inset(onebyte, src[i])) { | |
423 | charcopy(dest, &destlen, destsize, src[i++]); |
|
423 | charcopy(dest, &destlen, destsize, src[i++]); | |
424 | if (i == len) |
|
424 | if (i == len) | |
425 | goto done; |
|
425 | goto done; | |
@@ -439,14 +439,14 b' static Py_ssize_t _encode(const uint32_t' | |||||
439 | i++; |
|
439 | i++; | |
440 | break; |
|
440 | break; | |
441 | default: |
|
441 | default: | |
442 |
if (i |
|
442 | if (inset(onebyte, src[i])) { | |
443 | do { |
|
443 | do { | |
444 | charcopy(dest, &destlen, |
|
444 | charcopy(dest, &destlen, | |
445 | destsize, src[i++]); |
|
445 | destsize, src[i++]); | |
446 | } while (i < len && |
|
446 | } while (i < len && | |
447 |
i |
|
447 | inset(onebyte, src[i])); | |
448 | } |
|
448 | } | |
449 |
else if (i |
|
449 | else if (inset(twobytes, src[i])) { | |
450 | char c = src[i++]; |
|
450 | char c = src[i++]; | |
451 | charcopy(dest, &destlen, destsize, '_'); |
|
451 | charcopy(dest, &destlen, destsize, '_'); | |
452 | charcopy(dest, &destlen, destsize, |
|
452 | charcopy(dest, &destlen, destsize, |
General Comments 0
You need to be logged in to leave comments.
Login now