diff options
Diffstat (limited to 'external/rapidjson/memorystream.h')
-rw-r--r-- | external/rapidjson/memorystream.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/external/rapidjson/memorystream.h b/external/rapidjson/memorystream.h index beed1efb5..1d71d8a4f 100644 --- a/external/rapidjson/memorystream.h +++ b/external/rapidjson/memorystream.h @@ -15,7 +15,7 @@ #ifndef RAPIDJSON_MEMORYSTREAM_H_ #define RAPIDJSON_MEMORYSTREAM_H_ -#include "rapidjson.h" +#include "stream.h" #ifdef __clang__ RAPIDJSON_DIAG_PUSH @@ -42,8 +42,8 @@ struct MemoryStream { MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} - Ch Peek() const { return (src_ == end_) ? '\0' : *src_; } - Ch Take() { return (src_ == end_) ? '\0' : *src_++; } + Ch Peek() const { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } + Ch Take() { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } size_t Tell() const { return static_cast<size_t>(src_ - begin_); } Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } |