From: Eric Wong Date: Wed, 26 Feb 2020 00:44:05 +0000 (+0000) Subject: searchview: improve naming and simplify hash override X-Git-Tag: v1.4.0~95 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=815f07f300a4f1e95a50cba76bbff449fa653325 searchview: improve naming and simplify hash override `%over' could be confused for the overview SQLite DB instance, so call it `%override', instead. There's also no need to write a loop to override a hash when the language can do it for us. --- diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 0bd94774..287b0a28 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -366,14 +366,10 @@ sub new { } sub qs_html { - my ($self, %over) = @_; + my ($self, %override) = @_; - if (keys %over) { - my $tmp = bless { %$self }, ref($self); - foreach my $k (keys %over) { - $tmp->{$k} = $over{$k}; - } - $self = $tmp; + if (scalar(keys(%override))) { + $self = bless { (%$self, %override) }, ref($self); } my $q = uri_escape($self->{'q'}, MID_ESC);