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.
This commit is contained in:
parent
369de87e5d
commit
b67ff2fb11
@ -1169,8 +1169,8 @@ public:
|
|||||||
\return Iterator to member, if it exists.
|
\return Iterator to member, if it exists.
|
||||||
Otherwise returns \ref MemberEnd().
|
Otherwise returns \ref MemberEnd().
|
||||||
*/
|
*/
|
||||||
MemberIterator FindMember(const std::basic_string<Ch>& name) { 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(StringRef(name)); }
|
ConstMemberIterator FindMember(const std::basic_string<Ch>& name) const { return FindMember(GenericValue(StringRef(name))); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! Add a member (name-value pair) to the object.
|
//! Add a member (name-value pair) to the object.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user