summaryrefslogtreecommitdiff
path: root/markupsafe/_speedups.c
diff options
context:
space:
mode:
Diffstat (limited to 'markupsafe/_speedups.c')
-rw-r--r--markupsafe/_speedups.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/markupsafe/_speedups.c b/markupsafe/_speedups.c
index 2a09b42..f349feb 100644
--- a/markupsafe/_speedups.c
+++ b/markupsafe/_speedups.c
@@ -64,9 +64,9 @@ escape_unicode(PyUnicodeObject *in)
/* First we need to figure out how long the escaped string will be */
while (*(inp) || inp < inp_end) {
- if (*inp < ESCAPED_CHARS_TABLE_SIZE && escaped_chars_delta_len[*inp]) {
+ if (*inp < ESCAPED_CHARS_TABLE_SIZE) {
delta += escaped_chars_delta_len[*inp];
- ++erepl;
+ erepl += !!escaped_chars_delta_len[*inp];
}
++inp;
}