Apply CR suggestions

This commit is contained in:
wangyuan21 2021-10-25 18:22:21 +08:00
parent ba2bd5c3e3
commit 1e69400369
2 changed files with 3 additions and 3 deletions

View File

@ -1530,7 +1530,7 @@ void Path::makePath(const String& path, const InArgs& in) {
while (current != end) {
if (*current == '[') {
++current;
if (*current == '%') {
if (current != end && *current == '%') {
addPathInArg(path, in, itInArg, PathArgument::kindIndex);
++current;
} else {

View File

@ -2140,8 +2140,8 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, searchValueByPath) {
const Json::String expected("{"
"\"property1\":[0,1,null],"
"\"property2\":{"
"\"hello\":null,"
"\"object\":\"object\"},"
"\"hello\":null,"
"\"object\":\"object\"},"
"\"property3\":[[0,1,null],[2,3]]"
"}\n");
Json::Path path1(".property1.[%]", 2);