Files
Lioncache 62e481a608 JSONPool: Remove unnecessary bounds check
Given the generic context here, we should just use std::data
2025-09-05 14:16:20 -04:00

24 lines
463 B
C++

// SPDX-License-Identifier: MIT
#include <FEXCore/fextl/list.h>
#include <iterator>
#include <tiny-json.h>
namespace FEX::JSON {
struct JsonAllocator : jsonPool_t {
fextl::list<json_t> json_objects;
JsonAllocator();
};
template<typename T>
const json_t* CreateJSON(T& Container, JsonAllocator& Allocator) {
if (std::empty(Container)) {
return nullptr;
}
return json_createWithPool(std::data(Container), &Allocator);
}
} // namespace FEX::JSON