mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 16:34:13 +01:00
ircd:Ⓜ️:state: Use the appropriate codepath for undefined key dfs.
This commit is contained in:
parent
bbbb88fe46
commit
dbdc4a94d2
1 changed files with 11 additions and 2 deletions
|
@ -120,7 +120,12 @@ void
|
||||||
ircd::m::state::for_each(const string_view &root,
|
ircd::m::state::for_each(const string_view &root,
|
||||||
const iter_closure &closure)
|
const iter_closure &closure)
|
||||||
{
|
{
|
||||||
for_each(root, string_view{}, closure);
|
test(root, [&closure]
|
||||||
|
(const json::array &key, const string_view &val)
|
||||||
|
{
|
||||||
|
closure(key, val);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -140,7 +145,11 @@ bool
|
||||||
ircd::m::state::test(const string_view &root,
|
ircd::m::state::test(const string_view &root,
|
||||||
const iter_bool_closure &closure)
|
const iter_bool_closure &closure)
|
||||||
{
|
{
|
||||||
return test(root, string_view{}, closure);
|
return dfs(root, [&closure]
|
||||||
|
(const json::array &key, const string_view &val, const uint &, const uint &)
|
||||||
|
{
|
||||||
|
return closure(key, val);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
Loading…
Reference in a new issue