mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
ircd::json: Minor cleanup; simplify conditionals.
This commit is contained in:
parent
ea1c0dcae7
commit
57e70512d0
1 changed files with 6 additions and 22 deletions
24
ircd/json.cc
24
ircd/json.cc
|
@ -3401,24 +3401,16 @@ ircd::json::stringify(mutable_buffer &buf,
|
|||
consume(buf, copy(buf, "true"_sv));
|
||||
else
|
||||
consume(buf, copy(buf, "false"_sv));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case OBJECT:
|
||||
{
|
||||
if(v.serial)
|
||||
{
|
||||
stringify(buf, json::object{string_view{v}});
|
||||
break;
|
||||
}
|
||||
|
||||
if(v.object)
|
||||
{
|
||||
else if(v.object)
|
||||
stringify(buf, v.object, v.object + v.len);
|
||||
break;
|
||||
}
|
||||
|
||||
else
|
||||
consume(buf, copy(buf, empty_object));
|
||||
break;
|
||||
}
|
||||
|
@ -3426,17 +3418,10 @@ ircd::json::stringify(mutable_buffer &buf,
|
|||
case ARRAY:
|
||||
{
|
||||
if(v.serial)
|
||||
{
|
||||
stringify(buf, json::array{string_view{v}});
|
||||
break;
|
||||
}
|
||||
|
||||
if(v.array)
|
||||
{
|
||||
else if(v.array)
|
||||
stringify(buf, v.array, v.array + v.len);
|
||||
break;
|
||||
}
|
||||
|
||||
else
|
||||
consume(buf, copy(buf, empty_array));
|
||||
break;
|
||||
}
|
||||
|
@ -3450,7 +3435,6 @@ ircd::json::stringify(mutable_buffer &buf,
|
|||
consume(buf, copy(buf, lex_cast(v.floating)));
|
||||
else
|
||||
consume(buf, copy(buf, lex_cast(v.integer)));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue