diff options
author | Eric Wong <e@yhbt.net> | 2020-01-25 04:44:52 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-01-27 02:59:09 +0000 |
commit | d4cb7fb06031435cd25f5e000bf9c0e4b8b30177 (patch) | |
tree | c48a978f2cc0461b03d6c02c92da0d1dead789cd /lib | |
parent | c44a47c6d3463e35c68ab570cf286068f6b6657d (diff) | |
download | public-inbox-d4cb7fb06031435cd25f5e000bf9c0e4b8b30177.tar.gz |
It'll always be used as a callback, so there's no point in giving it a name to be called non-anonymously. Making assigments to it is slightly faster since there's no need to repeatedly do a lookup by name.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/SearchView.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 94a55b8d..97233069 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -14,7 +14,7 @@ use PublicInbox::SearchThread; our $LIM = 200; my %rmap_inc; -sub noop {} +my $noop = sub {}; sub mbox_results { my ($ctx) = @_; @@ -59,7 +59,7 @@ retry: if ($err) { $code = 400; $ctx->{-html_tip} = '<pre>'.err_txt($ctx, $err).'</pre><hr>'; - $cb = *noop; + $cb = $noop; } elsif ($total == 0) { if (defined($ctx->{-uxs_retried})) { # undo retry damage: @@ -71,7 +71,7 @@ retry: } $code = 404; $ctx->{-html_tip} = "<pre>\n[No results found]</pre><hr>"; - $cb = *noop; + $cb = $noop; } else { return adump($_[0], $mset, $q, $ctx) if $x eq 'A'; @@ -122,7 +122,7 @@ sub mset_summary { $$res .= "$pfx - by $f @ $date UTC [$pct%]\n\n"; } $$res .= search_nav_bot($mset, $q); - *noop; + $noop; } # shorten "/full/path/to/Foo/Bar.pm" to "Foo/Bar.pm" so error |