From 63f7329f3776a7465cb4b035baaf36e9a40ab1a2 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 18 Aug 2021 15:46:54 +1000 Subject: Index sims by UUID in ourSims as well. --- src/sledjchisl/sledjchisl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 3f3e171..3821a7b 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -1122,7 +1122,7 @@ struct _simList { int len, num; char **sims; - qtreetbl_t *byTab, *simsLua, *unsorted; + qtreetbl_t *byTab, *simsLua, *unsorted, *byUUID; // Stuff for the looping through sims, doing things, and waiting. int doIt; float la; @@ -1306,6 +1306,7 @@ void simNotFound(simData *simd, char *sim, char *type, int count, int window, in simd->sizeZ = getIntFromIni(ini, "Region.SizeZ"); // TODO - store a pointer instead of multiple copies of the data. ourSims->byTab->put(ourSims->byTab, sim, simd, sizeof(simData)); + ourSims->byUUID->put(ourSims->byUUID, simd->UUID, simd, sizeof(simData)); if (strcmp("unsorted", type) == 0) ourSims->unsorted->put(ourSims->unsorted, sim, simd, sizeof(simData)); ini->free(ini); @@ -1352,6 +1353,7 @@ void freeSimList(simList *sims) sims->byTab->free(sims->byTab); freeLuaTree(sims->simsLua); freeLuaTree(sims->unsorted); + freeLuaTree(sims->byUUID); free(sims->target); free(sims->backup); @@ -1371,6 +1373,7 @@ simList *getSims() ourSims = xzalloc(sizeof(simList)); ourSims->byTab = qtreetbl(0); ourSims->unsorted = qtreetbl(0); + ourSims->byUUID = qtreetbl(0); ourSims->doIt = FALSE; // Read or create simsLua -- cgit v1.1