diff options
author | fuzhufang <fuzhufang@163.com> | 2016-07-14 12:50:48 +0300 |
---|---|---|
committer | fuzhufang <fuzhufang@163.com> | 2016-07-14 12:50:48 +0300 |
commit | b67ff2fb11307dfe03926f5433175fb67072cc64 (patch) | |
tree | 11ebc17f1a8a806c6a3d08b19a635fd4f18b1f07 /include/rapidjson/document.h | |
parent | 369de87e5d7da05786731a712f25ab9b46c4b0ce (diff) |
if define RAPIDJSON_HAS_STDSTRING, FindMember use std::string, but it
also use internal::StrLen to get the string lengtht,
when it call FindMember(StringRef(name)).
Now use GenericValue construct it, then can use the std::string.size.
now it will be faster.
Diffstat (limited to 'include/rapidjson/document.h')
-rw-r--r-- | include/rapidjson/document.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 783479cb..e3e20dfb 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1169,8 +1169,8 @@ public: \return Iterator to member, if it exists. Otherwise returns \ref MemberEnd(). */ - MemberIterator FindMember(const std::basic_string<Ch>& name) { return FindMember(StringRef(name)); } - ConstMemberIterator FindMember(const std::basic_string<Ch>& name) const { return FindMember(StringRef(name)); } + MemberIterator FindMember(const std::basic_string<Ch>& name) { return FindMember(GenericValue(StringRef(name))); } + ConstMemberIterator FindMember(const std::basic_string<Ch>& name) const { return FindMember(GenericValue(StringRef(name))); } #endif //! Add a member (name-value pair) to the object. |