0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::json: Place missing break; cleanup branches.

This commit is contained in:
Jason Volk 2018-01-26 19:02:56 -08:00
parent 8d59fab2dc
commit 52ee74fe55

View file

@ -1218,38 +1218,44 @@ ircd::json::value::value(const value &other)
else switch(type)
{
case OBJECT:
if(!serial && object)
{
if(serial || !object)
break;
const size_t count(this->len);
create_string(serialized(object, object + count), [this, &count]
(mutable_buffer buffer)
{
json::stringify(buffer, object, object + count);
});
break;
}
case ARRAY:
{
if(serial || !array)
break;
case ARRAY:
if(!serial && array)
{
const size_t count(this->len);
create_string(serialized(array, array + count), [this, &count]
(mutable_buffer buffer)
{
json::stringify(buffer, array, array + count);
});
}
break;
}
case STRING:
if(!serial && alloc && string)
{
if(serial || !alloc || !string)
break;
create_string(serialized(*this), [this]
(mutable_buffer buffer)
{
json::stringify(buffer, *this);
});
break;
}
case LITERAL: