Skip to content

Commit

Permalink
Work around new V[K] AA initialisation FTBFS with old compilers
Browse files Browse the repository at this point in the history
Partially reverts fc06743.
  • Loading branch information
zorael committed Dec 17, 2023
1 parent 37d9e2c commit d98204d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion source/kameloso/plugins/counter.d
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,10 @@ void loadCounters(CounterPlugin plugin)
foreach (immutable channelName, channelCountersJSON; json.object)
{
// Initialise the AA
plugin.counters[channelName] = new Counter[string];
//plugin.counters[channelName] = new Counter[string]; // fails with older compilers
plugin.counters[channelName][string.init] = Counter.init;
auto channelCounters = channelName in plugin.counters;
(*channelCounters).remove(string.init);

foreach (immutable word, counterJSON; channelCountersJSON.object)
{
Expand Down
4 changes: 3 additions & 1 deletion source/kameloso/plugins/oneliner.d
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,10 @@ void loadOneliners(OnelinerPlugin plugin)
foreach (immutable channelName, const channelOnelinersJSON; allOnelinersJSON.object)
{
// Initialise the AA
plugin.onelinersByChannel[channelName] = new Oneliner[string];
//plugin.onelinersByChannel[channelName] = new Oneliner[string]; // fails with older compilers
plugin.onelinersByChannel[channelName][string.init] = Oneliner.init;
auto channelOneliners = channelName in plugin.onelinersByChannel;
(*channelOneliners).remove(string.init);

foreach (immutable trigger, const onelinerJSON; channelOnelinersJSON.object)
{
Expand Down
4 changes: 3 additions & 1 deletion source/kameloso/plugins/twitch/base.d
Original file line number Diff line number Diff line change
Expand Up @@ -2683,8 +2683,10 @@ in (((channelName.length && idString.length) ||
if (!customEmotes)
{
// Initialise it
plugin.customEmotesByChannel[channelName] = new bool[dstring];
//plugin.customEmotesByChannel[channelName] = new bool[dstring]; // fails with older compilers
plugin.customEmotesByChannel[channelName][dstring.init] = false;
customEmotes = channelName in plugin.customEmotesByChannel;
(*customEmotes).remove(dstring.init);
}

emoteImports =
Expand Down

0 comments on commit d98204d

Please sign in to comment.