mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +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
28
ircd/json.cc
28
ircd/json.cc
|
@ -3401,43 +3401,28 @@ 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;
|
||||
}
|
||||
|
||||
consume(buf, copy(buf, empty_object));
|
||||
else
|
||||
consume(buf, copy(buf, empty_object));
|
||||
break;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
consume(buf, copy(buf, empty_array));
|
||||
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