Skip to content

Commit

Permalink
Smallest optimization ever
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonw4331 committed Aug 17, 2021
1 parent de5ea21 commit 2231395
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/MyPlot/MyPlot.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,7 @@ public function getPlotByPosition(Position $position) : ?Plot {
return $plot;

$posSW = $posS->getSide(Vector3::SIDE_WEST, $plotLevel->roadWidth + 1);
$plot = $this->getPlotFast($posSW->x, $posSW->z, $plotLevel);
if($plot instanceof Plot)
return $plot;

return null; // this is the road and there are no plots here
return $this->getPlotFast($posSW->x, $posSW->z, $plotLevel);
}

private function getPlotFast(float $x, float $z, PlotLevelSettings $plotLevel) : ?Plot {
Expand Down

0 comments on commit 2231395

Please sign in to comment.