mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
More minor optimizations
This commit is contained in:
parent
ca5e7520cb
commit
747662ea8c
2 changed files with 16 additions and 8 deletions
|
|
@ -232,8 +232,8 @@ namespace MinecraftClient.Mapping
|
|||
int tentativeGScore = current.GScore + (int)current.Location.DistanceSquared(neighbor);
|
||||
|
||||
// If the neighbor is not in the GScoreDict OR its current tentativeGScore is lower than the previously saved one:
|
||||
if (!gScoreDict.ContainsKey(neighbor) ||
|
||||
(gScoreDict.ContainsKey(neighbor) && tentativeGScore < gScoreDict[neighbor]))
|
||||
if (!gScoreDict.TryGetValue(neighbor, out int existingGScore) ||
|
||||
tentativeGScore < existingGScore)
|
||||
{
|
||||
// Save the new relation between the neighbored block and the current one
|
||||
cameFrom[neighbor] = current.Location;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue