0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::json: Relax assertion for array::empty() expectations.

This commit is contained in:
Jason Volk 2019-02-21 14:10:40 -08:00
parent 0cb852e732
commit d083d09e03

View file

@ -2490,7 +2490,11 @@ ircd::json::array::empty()
const
{
const string_view &sv{*this};
assert(sv.size() > 2 || (sv.empty() || sv == empty_array));
// Allow empty objects '{}' to pass this assertion; this function is not
// a type-check. Some serializers (like browser JS) might give an empty
// object before it has any context that the set is an array; it doesn't
// matter here for us.
assert(sv.size() > 2 || sv.empty() || sv == empty_array || sv == empty_object);
return sv.size() <= 2;
}