Forums WoW Modding Support Archives TrinityCore Discord Archives [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

[DiscordArchive] maybe it's best to force a cached vector using a static variable to prevent multiple re-building of

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
07-10-2025, 06:01 PM
#1
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?
rektbyfaith
07-10-2025, 06:01 PM #1

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?

rektbyfaith
Administrator
0
07-10-2025, 06:02 PM
#2
Archived author: Telegrill • Posted: 2025-07-10T18:02:24.457000+00:00
Original source

it would be initialized once and reused every call
rektbyfaith
07-10-2025, 06:02 PM #2

Archived author: Telegrill • Posted: 2025-07-10T18:02:24.457000+00:00
Original source

it would be initialized once and reused every call

rektbyfaith
Administrator
0
07-10-2025, 06:03 PM
#3
Archived author: Tea • Posted: 2025-07-10T18:03:32.336000+00:00
Original source

you are overthinking it
rektbyfaith
07-10-2025, 06:03 PM #3

Archived author: Tea • Posted: 2025-07-10T18:03:32.336000+00:00
Original source

you are overthinking it

rektbyfaith
Administrator
0
07-10-2025, 06:03 PM
#4
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;
}
```
rektbyfaith
07-10-2025, 06:03 PM #4

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;
}
```

rektbyfaith
Administrator
0
07-10-2025, 06:04 PM
#5
Archived author: Tea • Posted: 2025-07-10T18:04:20.168000+00:00
Original source

you cant
rektbyfaith
07-10-2025, 06:04 PM #5

Archived author: Tea • Posted: 2025-07-10T18:04:20.168000+00:00
Original source

you cant

rektbyfaith
Administrator
0
07-10-2025, 06:04 PM
#6
Archived author: Tea • Posted: 2025-07-10T18:04:28.904000+00:00
Original source

you are capturing [this] in one of the lambdas
rektbyfaith
07-10-2025, 06:04 PM #6

Archived author: Tea • Posted: 2025-07-10T18:04:28.904000+00:00
Original source

you are capturing [this] in one of the lambdas

rektbyfaith
Administrator
0
07-10-2025, 06:04 PM
#7
Archived author: Telegrill • Posted: 2025-07-10T18:04:42.329000+00:00
Original source

oh true
rektbyfaith
07-10-2025, 06:04 PM #7

Archived author: Telegrill • Posted: 2025-07-10T18:04:42.329000+00:00
Original source

oh true

rektbyfaith
Administrator
0
07-10-2025, 06:04 PM
#8
Archived author: Tea • Posted: 2025-07-10T18:04:57.087000+00:00
Original source

or caster or something
rektbyfaith
07-10-2025, 06:04 PM #8

Archived author: Tea • Posted: 2025-07-10T18:04:57.087000+00:00
Original source

or caster or something

rektbyfaith
Administrator
0
07-10-2025, 06:05 PM
#9
Archived author: Tea • Posted: 2025-07-10T18:05:00.083000+00:00
Original source

anything
rektbyfaith
07-10-2025, 06:05 PM #9

Archived author: Tea • Posted: 2025-07-10T18:05:00.083000+00:00
Original source

anything

rektbyfaith
Administrator
0
07-10-2025, 06:05 PM
#10
Archived author: Telegrill • Posted: 2025-07-10T18:05:47.532000+00:00
Original source

well, caching would be *fine*, but unsafe for anything dynamic
rektbyfaith
07-10-2025, 06:05 PM #10

Archived author: Telegrill • Posted: 2025-07-10T18:05:47.532000+00:00
Original source

well, caching would be *fine*, but unsafe for anything dynamic

Pages (2): 1 2 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)