[DiscordArchive] maybe it's best to force a cached vector using a static variable to prevent multiple re-building of
[DiscordArchive] maybe it's best to force a cached vector using a static variable to prevent multiple re-building of
Archived author: Telegrill • Posted: 2025-07-10T18:01:51.660000+00:00
Original source
maybe it's best to force a cached vector using a static variable to prevent multiple re-building of rules every time the spell is cast?
Archived author: Telegrill • Posted: 2025-07-10T18:02:24.457000+00:00
Original source
it would be initialized once and reused every call
Archived author: Tea • Posted: 2025-07-10T18:03:32.336000+00:00
Original source
you are overthinking it
Archived author: Telegrill • Posted: 2025-07-10T18:03:58.103000+00:00
Original source
instead of
```cpp
static std::vector<PriorityRules> GetRules()
{ return CreatePriorityRules({ ... }); }
```
this
```cpp
std::vector<PriorityRules> const& GetRules()
{
static const std::vector<PriorityRules> rules = CreatePriorityRules({ ... });
return rules;
}
```
Archived author: Tea • Posted: 2025-07-10T18:04:20.168000+00:00
Original source
you cant
Archived author: Tea • Posted: 2025-07-10T18:04:28.904000+00:00
Original source
you are capturing [this] in one of the lambdas
Archived author: Telegrill • Posted: 2025-07-10T18:04:42.329000+00:00
Original source
oh true
Archived author: Tea • Posted: 2025-07-10T18:04:57.087000+00:00
Original source
or caster or something
Archived author: Tea • Posted: 2025-07-10T18:05:00.083000+00:00
Original source
anything
Archived author: Telegrill • Posted: 2025-07-10T18:05:47.532000+00:00
Original source
well, caching would be *fine*, but unsafe for anything dynamic