From 2943b3850c5cb9e4561c3d109b4513a123bf4db7 Mon Sep 17 00:00:00 2001 From: Jordan Milne Date: Thu, 18 Sep 2014 17:21:12 -0300 Subject: Use a lookup table for subject_find_special_char --- src/inlines.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/inlines.c') diff --git a/src/inlines.c b/src/inlines.c index 145825c..71d75e9 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -768,13 +768,29 @@ node_inl *parse_chunk_inlines(chunk *chunk, reference_map *refmap) static int subject_find_special_char(subject *subj) { - static const char CHARS[] = "\n\\`&_*[]pos + 1; while (n < subj->input.len) { - if (memchr(CHARS, subj->input.data[n], CHARS_SIZE)) + if (SPECIAL_CHARS[subj->input.data[n]]) return n; n++; } -- cgit v1.2.3