We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1f3fff commit 1858474Copy full SHA for 1858474
fable/src/fable/conf.cpp
@@ -73,12 +73,12 @@ Conf Conf::at(const JsonPointer& key) const {
73
74
size_t Conf::erase(const std::string& key) { return data_.erase(key); }
75
76
+// NOLINTNEXTLINE(misc-no-recursion)
77
size_t Conf::erase(const JsonPointer& key) {
- auto n = 0;
78
+ std::size_t n = 0;
79
try {
80
Json& parent = data_.at(key.parent_pointer());
- // The const_cast is necessary because of a bug in the nlohmann::json_pointer type.
81
- n = parent.erase(const_cast<JsonPointer&>(key).back());
+ n = parent.erase(key.back());
82
if (parent.empty()) {
83
n += erase(key.parent_pointer());
84
}
0 commit comments