Skip to content

Commit 25146f9

Browse files
Remove redundant sanity checks (#77)
1 parent eeb41c7 commit 25146f9

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/OpenStreetMap-esp32.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,6 @@ std::optional<std::unique_ptr<MemoryBuffer>> OpenStreetMap::urlToBuffer(const ch
438438

439439
void OpenStreetMap::PNGDraw(PNGDRAW *pDraw)
440440
{
441-
if (!currentInstance || !currentInstance->currentTileBuffer)
442-
return;
443-
444441
uint16_t *destRow = currentInstance->currentTileBuffer + (pDraw->y * OSM_TILESIZE);
445442
getPNGForCore()->getLineAsRGB565(pDraw, destRow, PNG_RGB565_BIG_ENDIAN, 0xffffffff);
446443
}
@@ -486,10 +483,8 @@ bool OpenStreetMap::fetchTile(CachedTile &tile, uint32_t x, uint32_t y, uint8_t
486483

487484
currentInstance = this;
488485
currentTileBuffer = tile.buffer;
486+
489487
const int decodeResult = png->decode(0, PNG_FAST_PALETTE);
490-
currentTileBuffer = nullptr;
491-
currentInstance = nullptr;
492-
493488
if (decodeResult != PNG_SUCCESS)
494489
{
495490
result = "Decoding " + String(url) + " failed with code: " + String(decodeResult);

0 commit comments

Comments
 (0)