Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use memchr() to implement isBoundaryChar() instead of our own impleme…

…ntation. This makes it significantly faster.
  • Loading branch information...
commit ebf15a4e519d4af64e220968a5ab06235594fab9 1 parent 8b3ff6b
@FooBarWidget authored
Showing with 2 additions and 11 deletions.
  1. +2 −11 MultipartParser.h
View
13 MultipartParser.h
@@ -94,17 +94,8 @@ class MultipartParser {
return c | 0x20;
}
- bool isBoundaryChar(char c) const {
- const char *current = boundary.c_str();
- const char *end = current + boundary.size();
-
- while (current < end) {
- if (*current == c) {
- return true;
- }
- current++;
- }
- return false;
+ inline bool isBoundaryChar(char c) const {
+ return memchr(boundaryData, c, boundarySize) != NULL;
}
bool isHeaderFieldCharacter(char c) const {
Please sign in to comment.
Something went wrong with that request. Please try again.