diff options
author | dakkar <dakkar@thenautilus.net> | 2020-01-25 16:25:20 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2020-01-25 16:25:20 +0000 |
commit | e55f4624cf43a7da5e67706d2759a38298b327e7 (patch) | |
tree | 22cca5121fe86413984d71339a5db70142ea8cd6 /lib/MaildirIndexer/Store.rakumod | |
parent | say where things went wrong (diff) | |
download | MaildirIndexer-e55f4624cf43a7da5e67706d2759a38298b327e7.tar.gz MaildirIndexer-e55f4624cf43a7da5e67706d2759a38298b327e7.tar.bz2 MaildirIndexer-e55f4624cf43a7da5e67706d2759a38298b327e7.zip |
Revert "fewer temporary variables"
This reverts commit 314ee051c170c33d2c912b6750f916b73f9cb507.
I think that the bug with LEAVE messes up return values inside
Log::Timeline as well
Diffstat (limited to 'lib/MaildirIndexer/Store.rakumod')
-rw-r--r-- | lib/MaildirIndexer/Store.rakumod | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/MaildirIndexer/Store.rakumod b/lib/MaildirIndexer/Store.rakumod index 02ffa1d..791f9a4 100644 --- a/lib/MaildirIndexer/Store.rakumod +++ b/lib/MaildirIndexer/Store.rakumod @@ -25,12 +25,12 @@ method start(--> Nil) { MaildirIndexer::LogTimelineSchema::Scan::End.log(); } when $file ~~ :e & :f { - MaildirIndexer::LogTimelineSchema::Store::Add.log: :file($file.path), { + MaildirIndexer::LogTimelineSchema::Store::Add.log: :file($file.path), -> { self.add-file($file); } } when $file ~~ :!e { - MaildirIndexer::LogTimelineSchema::Store::Rm.log: :file($file.path), { + MaildirIndexer::LogTimelineSchema::Store::Rm.log: :file($file.path), -> { self.del-file($file); } } @@ -57,14 +57,15 @@ method del-file(IO:D $file --> Nil) { } method mailbox-for-email(MaildirIndexer::Email:D $email --> Str) { + my Str $result; MaildirIndexer::LogTimelineSchema::Store::Find.log: { $!lock.protect: { for @!indices -> $index { - with $index.mailbox-for-email($email) { return $_ }; + with $index.mailbox-for-email($email) { $result = $_; last }; } } - return Nil; } + return $result; } sub mailbox-from-path(Str() $path --> Str) { |