0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 07:23:53 +01:00

ircd::json: Memoize query for type.

This commit is contained in:
Jason Volk 2020-06-11 16:49:12 -07:00
parent afcb22b726
commit 5ede78afe8

View file

@ -749,12 +749,12 @@ ircd::json::merge(stack::object &out,
void merge(const string_view &v)
{
if(type(v) == json::OBJECT)
_merge_object(v);
else if(type(v) == json::ARRAY)
_merge_array(v);
else
this->v = v;
switch(json::type(v))
{
case json::OBJECT: _merge_object(v); break;
case json::ARRAY: _merge_array(v); break;
default: this->v = v; break;
}
}
void _compose_object(json::stack &out, json::stack::object &object) const