From 396ab297a8d2f99c80bc5552b664c8046872fbc5 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 21 Mar 2023 21:43:36 +0000 Subject: [PATCH] all: prefer postfix dereference syntax --- lib/PoorBooru/Backend/Controller/Media.pm | 2 +- lib/PoorBooru/Backend/Controller/Tags.pm | 4 ++-- lib/SeaweedFS/Client.pm | 6 +++--- templates/gallery.html.ep | 2 +- templates/tags.html.ep | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/PoorBooru/Backend/Controller/Media.pm b/lib/PoorBooru/Backend/Controller/Media.pm index 93ba2b9..03335d3 100644 --- a/lib/PoorBooru/Backend/Controller/Media.pm +++ b/lib/PoorBooru/Backend/Controller/Media.pm @@ -27,7 +27,7 @@ sub list ($self) media_src => $self->seaweed->url_for( SeaweedFS::FID->from_string($_->{seaweedfs_fid}) ), - }, @{$res->json->{media}}; + }, $res->json->{media}->@*; return $self->render( template => "gallery", diff --git a/lib/PoorBooru/Backend/Controller/Tags.pm b/lib/PoorBooru/Backend/Controller/Tags.pm index c3cdc3a..381d623 100644 --- a/lib/PoorBooru/Backend/Controller/Tags.pm +++ b/lib/PoorBooru/Backend/Controller/Tags.pm @@ -24,7 +24,7 @@ sub list ($self) name => $_->{name}, count => $_->{count}, uri => $self->url_for("tag_show", tag_id_or_name => $_->{name}), - }, @{$res->json->{tags}}; + }, $res->json->{tags}->@*; return $self->render( template => "tags", @@ -54,7 +54,7 @@ sub show ($self) media_src => $self->seaweed->url_for( SeaweedFS::FID->from_string($_->{seaweedfs_fid}) ), - }, @{$res->json->{media}}; + }, $res->json->{media}->@*; return $self->render( template => "gallery", diff --git a/lib/SeaweedFS/Client.pm b/lib/SeaweedFS/Client.pm index a97924e..023672d 100644 --- a/lib/SeaweedFS/Client.pm +++ b/lib/SeaweedFS/Client.pm @@ -34,17 +34,17 @@ sub url_for my $vid = $fid->volume_id; - if (!defined($self->{_vurls}{$vid}) || @{$self->{_vurls}{$vid}} == 0) { + if (!defined($self->{_vurls}{$vid}) || $self->{_vurls}{$vid}->@* == 0) { my $res = $self->{_ua} ->get("$self->{_murl}/dir/lookup?fileId=$fid&read=yes") ->result; $self->{_vurls}{$vid} = [ - map { $_->{publicUrl} } @{$res->json->{locations}} + map { $_->{publicUrl} } $res->json->{locations}->@* ]; } - my $url = sample(1, @{$self->{_vurls}{$vid}}); + my $url = sample(1, $self->{_vurls}{$vid}->@*); return undef unless defined $url; $url = "http://$url" if $url !~ m{^https?://}; diff --git a/templates/gallery.html.ep b/templates/gallery.html.ep index 0a80668..c3d2f59 100644 --- a/templates/gallery.html.ep +++ b/templates/gallery.html.ep @@ -1,7 +1,7 @@ % layout "main";