mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
minimize extra dv::value copies
This commit is contained in:
parent
bd176f24e1
commit
3953583605
14 changed files with 29 additions and 26 deletions
|
|
@ -477,11 +477,11 @@ dv::value WorldRegions::fetchEntities(int x, int z) {
|
|||
uint32_t bytesSize;
|
||||
const ubyte* data = getData(x, z, REGION_LAYER_ENTITIES, bytesSize);
|
||||
if (data == nullptr) {
|
||||
return dv::none;
|
||||
return nullptr;
|
||||
}
|
||||
auto map = json::from_binary(data, bytesSize);
|
||||
if (map.size() == 0) {
|
||||
return dv::none;
|
||||
return nullptr;
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue