From 178fa2accbad112807b50d937cb945f5266f2d09 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 31 Dec 2019 15:15:43 +0000 Subject: I don't understand this context/flat thing --- lib/MaildirIndexer/Index/ByAddresses.rakumod | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/MaildirIndexer/Index/ByAddresses.rakumod b/lib/MaildirIndexer/Index/ByAddresses.rakumod index d9fd945..507c0e7 100644 --- a/lib/MaildirIndexer/Index/ByAddresses.rakumod +++ b/lib/MaildirIndexer/Index/ByAddresses.rakumod @@ -46,9 +46,12 @@ method add-mail(MaildirIndexer::Email:D $email, Str:D $mailbox --> Nil) { method del-path(IO:D $file, Str:D $mailbox --> Nil) { MaildirIndexer::LogTimelineSchema::Index::Rm.log: :class('ByAddresses'),:$mailbox, -> { - my Str (@addresses,) = %!addresses-for-file{$file.path}:delete or return; + # using `Str @addresses` fails when the path isn't present in + # the hash, because it tries to assign the (undefined) + # Array[Str] as a single element, instead of splatting it + my Array[Str] $addresses = %!addresses-for-file{$file.path}:delete or return; - self.account-for(@addresses,$mailbox,-1); + self.account-for($addresses,$mailbox,-1); return; } -- cgit v1.2.3