Skip to content

Commit 1858474

Browse files
committed
fable: Remove work-around of nlohmann_json bug
It appears the bug has been resolved for some time. (The nature of the bug prevented compilation, so if it compiles, it should work.)
1 parent f1f3fff commit 1858474

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fable/src/fable/conf.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ Conf Conf::at(const JsonPointer& key) const {
7373

7474
size_t Conf::erase(const std::string& key) { return data_.erase(key); }
7575

76+
// NOLINTNEXTLINE(misc-no-recursion)
7677
size_t Conf::erase(const JsonPointer& key) {
77-
auto n = 0;
78+
std::size_t n = 0;
7879
try {
7980
Json& parent = data_.at(key.parent_pointer());
80-
// The const_cast is necessary because of a bug in the nlohmann::json_pointer type.
81-
n = parent.erase(const_cast<JsonPointer&>(key).back());
81+
n = parent.erase(key.back());
8282
if (parent.empty()) {
8383
n += erase(key.parent_pointer());
8484
}

0 commit comments

Comments
 (0)