[ox/oc] Make write omit lists if length is 0
This commit is contained in:
parent
717bbd2e0f
commit
d5252a45d3
2
deps/ox/src/ox/oc/write.hpp
vendored
2
deps/ox/src/ox/oc/write.hpp
vendored
@ -89,7 +89,7 @@ class OrganicClawWriter {
|
|||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Error OrganicClawWriter::field(const char *key, T *val, std::size_t len) noexcept {
|
Error OrganicClawWriter::field(const char *key, T *val, std::size_t len) noexcept {
|
||||||
if (targetValid()) {
|
if (targetValid() && len) {
|
||||||
OrganicClawWriter w((Json::Value(Json::arrayValue)));
|
OrganicClawWriter w((Json::Value(Json::arrayValue)));
|
||||||
for (std::size_t i = 0; i < len; ++i) {
|
for (std::size_t i = 0; i < len; ++i) {
|
||||||
oxReturnError(w.field("", &val[i]));
|
oxReturnError(w.field("", &val[i]));
|
||||||
|
Loading…
Reference in New Issue
Block a user