Skip to content

Commit 0e976bb

Browse files
committed
Small optimization
1 parent 1b0a813 commit 0e976bb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Source/ProceduralDungeon/Private/DungeonGraph.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,10 @@ FVector UDungeonGraph::GetDungeonBoundsExtent() const
343343
return GetDungeonBounds(Transform).Extent;
344344
}
345345

346-
struct FRoomCandidatePredicate
346+
static bool RoomCandidatePredicate(const FRoomCandidate& A, const FRoomCandidate& B)
347347
{
348-
bool operator()(const FRoomCandidate& A, const FRoomCandidate& B) const
349-
{
350-
return A.Score > B.Score;
351-
}
352-
};
348+
return A.Score > B.Score;
349+
}
353350

354351
bool UDungeonGraph::FilterAndSortRooms(const TArray<URoomData*>& RoomList, const FDoorDef& FromDoor, TArray<FRoomCandidate>& SortedRooms, const FScoreCallback& CustomScore) const
355352
{
@@ -387,7 +384,7 @@ bool UDungeonGraph::FilterAndSortRooms(const TArray<URoomData*>& RoomList, const
387384
if (!NewBounds.GetCompatibilityScore(Bounds, Candidate.Score, CustomScore))
388385
continue;
389386

390-
SortedRooms.HeapPush(Candidate, FRoomCandidatePredicate());
387+
SortedRooms.HeapPush(Candidate, ::RoomCandidatePredicate);
391388
}
392389
}
393390

0 commit comments

Comments
 (0)