Commit 3ee552fec5c4e5e478ce4f6fbe60cf65218f8e84
Committed by
Jay Berkenbilt
1 parent
9096df74
Replace strchr in QPDFTokenizer::is_delimiter
Showing
1 changed file
with
6 additions
and
2 deletions
libqpdf/QPDFTokenizer.cc
| @@ -14,10 +14,14 @@ | @@ -14,10 +14,14 @@ | ||
| 14 | #include <stdlib.h> | 14 | #include <stdlib.h> |
| 15 | #include <string.h> | 15 | #include <string.h> |
| 16 | 16 | ||
| 17 | -static bool | 17 | +static inline bool |
| 18 | is_delimiter(char ch) | 18 | is_delimiter(char ch) |
| 19 | { | 19 | { |
| 20 | - return (strchr(" \t\n\v\f\r()<>[]{}/%", ch) != nullptr); | 20 | + return ( |
| 21 | + ch == ' ' || ch == '\n' || ch == '/' || ch == '(' || ch == ')' || | ||
| 22 | + ch == '{' || ch == '}' || ch == '<' || ch == '>' || ch == '[' || | ||
| 23 | + ch == ']' || ch == '%' || ch == '\t' || ch == '\r' || ch == '\v' || | ||
| 24 | + ch == '\f' || ch == 0); | ||
| 21 | } | 25 | } |
| 22 | 26 | ||
| 23 | namespace | 27 | namespace |