File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,7 @@ namespace compatibility
6060
6161 void RemoveIncompatibilities (nlohmann::json& json)
6262 {
63-
64- for (auto jsonIter = json.begin (); jsonIter != json.end (); ++jsonIter)
63+ for (auto jsonIter = json.begin (); jsonIter != json.end ();)
6564 {
6665 const auto & key = jsonIter.key ();
6766 auto & value = jsonIter.value ();
@@ -77,23 +76,24 @@ namespace compatibility
7776 else if (value.is_object ())
7877 {
7978 RemoveIncompatibilities (value);
79+ ++jsonIter;
8080 }
8181 else if (value.is_array ())
8282 {
83- auto idx = 0 ;
8483 for (auto valueIter = value.begin (); valueIter != value.end ();)
8584 {
86- auto & item = *valueIter;
87-
88- if (item.is_object ())
89- RemoveIncompatibilities (item);
85+ if (valueIter->is_object ())
86+ RemoveIncompatibilities (*valueIter);
9087
9188 ++valueIter;
9289 }
90+
91+ ++jsonIter;
9392 }
9493 else if (key == " data" )
9594 {
9695 json[key] = std::regex_replace (json[key].get <std::string>(), std::regex (R"( \r\n)" ), " \n " );
96+ ++jsonIter;
9797 }
9898 else if (key == " uri" )
9999 {
@@ -103,7 +103,11 @@ namespace compatibility
103103 uri = std::regex_replace (uri, std::regex (R"( \.ts$)" ), " .cpp" );
104104
105105 json[key] = std::filesystem::canonical (uri).string ();
106+
107+ ++jsonIter;
106108 }
109+ else
110+ ++jsonIter;
107111 }
108112 }
109113
You can’t perform that action at this time.
0 commit comments