0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +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,39 +1218,45 @@ ircd::json::value::value(const value &other)
else switch(type)
{
case OBJECT:
if(!serial && object)
{
const size_t count(this->len);
create_string(serialized(object, object + count), [this, &count]
(mutable_buffer buffer)
{
json::stringify(buffer, object, object + count);
});
}
{
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)
{
if(serial || !array)
break;
const size_t count(this->len);
create_string(serialized(array, array + count), [this, &count]
(mutable_buffer buffer)
{
const size_t count(this->len);
create_string(serialized(array, array + count), [this, &count]
(mutable_buffer buffer)
{
json::stringify(buffer, array, array + count);
});
}
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)
{
create_string(serialized(*this), [this]
(mutable_buffer buffer)
{
json::stringify(buffer, *this);
});
}
json::stringify(buffer, *this);
});
break;
}
case LITERAL:
case NUMBER: