Open thgcode opened 5 years ago
Currently, the get_tile_obj method uses a linear search to check if the tile is in the zone's bound ranges. However, I'm not sure, maybe it could be optimized to have a hash table lookup. It would be faster for maps with a large number of zones. See https://stackoverflow.com/questions/8462939/how-to-hash-a-range-of-numbers-to-a-single-position-in-the-hash-table .
@thgcode I was actually wondering if I could have improved the speed. Thanks for the resource you sent, I'll try to investigate. Should you have any progress feel free to pull request.
Currently, the get_tile_obj method uses a linear search to check if the tile is in the zone's bound ranges. However, I'm not sure, maybe it could be optimized to have a hash table lookup. It would be faster for maps with a large number of zones. See https://stackoverflow.com/questions/8462939/how-to-hash-a-range-of-numbers-to-a-single-position-in-the-hash-table .