diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-09-17 09:35:49 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-09-17 09:35:49 +0200 |
commit | f62ebc5c811b76c05327dd56877024df60a47a9b (patch) | |
tree | 81e98c9bf5d11e1bb7e2bff81105af879d43a32a /external/rapidjson/memorystream.h | |
parent | Merge pull request #1081 (diff) | |
download | monero-f62ebc5c811b76c05327dd56877024df60a47a9b.tar.xz |
update rapidjson
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; } |