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:
parent
8d59fab2dc
commit
52ee74fe55
1 changed files with 30 additions and 24 deletions
18
ircd/json.cc
18
ircd/json.cc
|
@ -1218,38 +1218,44 @@ ircd::json::value::value(const value &other)
|
||||||
else switch(type)
|
else switch(type)
|
||||||
{
|
{
|
||||||
case OBJECT:
|
case OBJECT:
|
||||||
if(!serial && object)
|
|
||||||
{
|
{
|
||||||
|
if(serial || !object)
|
||||||
|
break;
|
||||||
|
|
||||||
const size_t count(this->len);
|
const size_t count(this->len);
|
||||||
create_string(serialized(object, object + count), [this, &count]
|
create_string(serialized(object, object + count), [this, &count]
|
||||||
(mutable_buffer buffer)
|
(mutable_buffer buffer)
|
||||||
{
|
{
|
||||||
json::stringify(buffer, object, object + count);
|
json::stringify(buffer, object, object + count);
|
||||||
});
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ARRAY:
|
||||||
|
{
|
||||||
|
if(serial || !array)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ARRAY:
|
|
||||||
if(!serial && array)
|
|
||||||
{
|
|
||||||
const size_t count(this->len);
|
const size_t count(this->len);
|
||||||
create_string(serialized(array, array + count), [this, &count]
|
create_string(serialized(array, array + count), [this, &count]
|
||||||
(mutable_buffer buffer)
|
(mutable_buffer buffer)
|
||||||
{
|
{
|
||||||
json::stringify(buffer, array, array + count);
|
json::stringify(buffer, array, array + count);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case STRING:
|
case STRING:
|
||||||
if(!serial && alloc && string)
|
|
||||||
{
|
{
|
||||||
|
if(serial || !alloc || !string)
|
||||||
|
break;
|
||||||
|
|
||||||
create_string(serialized(*this), [this]
|
create_string(serialized(*this), [this]
|
||||||
(mutable_buffer buffer)
|
(mutable_buffer buffer)
|
||||||
{
|
{
|
||||||
json::stringify(buffer, *this);
|
json::stringify(buffer, *this);
|
||||||
});
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case LITERAL:
|
case LITERAL:
|
||||||
|
|
Loading…
Reference in a new issue