Skip to content

Commit

Permalink
Update lib/src/layer/tile_layer/tile_image_manager.dart
Browse files Browse the repository at this point in the history
Co-authored-by: mootw <spencer.mein@gmail.com>
  • Loading branch information
monsieurtanuki and mootw authored Aug 29, 2024
1 parent 6f93793 commit bbc36c4
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions lib/src/layer/tile_layer/tile_image_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,11 @@ class TileImageManager {
_positionCoordinates.remove(key);
final cleanKey = TileCoordinates.key(key);

/// True if there are other positionCoordinates with the same tileImage.
bool findCleanKey() {
for (final positionCoordinates in _positionCoordinates) {
if (TileCoordinates.key(positionCoordinates) == cleanKey) {
return true;
}
// guard if positionCoordinates with the same tileImage.
for (final positionCoordinates in _positionCoordinates) {
if (TileCoordinates.key(positionCoordinates) == cleanKey) {
return;
}
return false;
}

if (findCleanKey()) {
return;
}

final removed = _tiles.remove(cleanKey);
Expand Down

0 comments on commit bbc36c4

Please sign in to comment.