~mil/mepo

5beb6116a1f1e8f3fe07f8070e93ecbedf806d66 — Miles Alan 1 year, 2 months ago 6e780f5 nonblock-fileio-rendering
Remove unnecessary stat check & alloc on tile_ui_retreive_or_queue when online
1 files changed, 1 insertions(+), 4 deletions(-)

M src/TileCache.zig
M src/TileCache.zig => src/TileCache.zig +1 -4
@@ 284,10 284,7 @@ pub fn tile_ui_retreive_or_queue(tile_cache: *@This(), coords: types.XYZ) !TileD
        return TileData{ .texture = texture };
    } else if (tile_cache.transfer_map.get(coords)) |transfer| {
        return TileData{ .transfer_datum = transfer.* };
    }

    const can_load_from_fs = tile_cache.cache_dir != null and !try tile_cache.tile_exists_in_fs_and_non_expired(coords);
    if (tile_cache.thread_download == null and !can_load_from_fs) {
    } else if (tile_cache.thread_download == null and (tile_cache.cache_dir == null or !try tile_cache.tile_exists_in_fs_and_non_expired(coords))) {
        return TileData{ .error_type = .Offline };
    } else {
        try tile_cache.queue_lifo_ui.put(coords, void{});