21 lines
818 B
Diff
21 lines
818 B
Diff
# UNDF: UNDF-2026-000001037
|
|
--- a/src/modules/userinterface/legacymenu/racescreens/humanselect.cpp
|
|
+++ b/src/modules/userinterface/legacymenu/racescreens/humanselect.cpp
|
|
@@ -224,12 +224,15 @@
|
|
std::vector<GfDriver *> drivers =
|
|
GfDrivers::self()->getDriversWithTypeAndCategory(ROB_VAL_HUMAN);
|
|
|
|
+ // Build a set from staging for O(1) lookup instead of O(S) linear scan per driver.
|
|
+ std::unordered_set<std::string> stagingSet(staging.cbegin(), staging.cend());
|
|
+
|
|
i = 0;
|
|
|
|
for (auto driver : drivers)
|
|
{
|
|
const char *name = driver->getName().c_str();
|
|
|
|
- if (std::find(staging.cbegin(), staging.cend(), name) == staging.end())
|
|
+ if (stagingSet.find(name) == stagingSet.end())
|
|
GfuiScrollListInsertElement(hscr, available, name, i++, (void *)name);
|
|
}
|
|
|