about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchView.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-09-30 21:00:19 +0000
committerEric Wong <e@80x24.org>2015-09-30 21:09:18 +0000
commit709a1979302ef5dbb40babb84821b079868490a1 (patch)
treed38f9785c0ffebc1f36e3d7916ca75467e2fe8e9 /lib/PublicInbox/SearchView.pm
parentebf564bad83e0c160b5088c7aaa9862d47735226 (diff)
downloadpublic-inbox-709a1979302ef5dbb40babb84821b079868490a1.tar.gz
It doesn't actually give performance improvements unless we
use types with "my", but we don't do that.  We'll only continue
using fields with Danga::Socket-derived classes where they're
required.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r--lib/PublicInbox/SearchView.pm19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 6bc66ceb..cfc650f4 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -257,27 +257,24 @@ sub adump {
 package PublicInbox::SearchQuery;
 use strict;
 use warnings;
-use fields qw(q o t x r);
 use PublicInbox::Hval;
 
 sub new {
         my ($class, $cgi) = @_;
-        my $self = fields::new($class);
-        $self->{q} = $cgi->param('q');
-        $self->{x} = $cgi->param('x') || '';
-        $self->{o} = int($cgi->param('o') || 0) || 0;
-        my $r = $cgi->param('r');
-        $self->{r} = (defined $r && $r ne '0');
-
-        $self;
+        my $r => $cgi->param('r'),
+        bless {
+                q => $cgi->param('q'),
+                x => $cgi->param('x') || '',
+                o => int($cgi->param('o') || 0) || 0,
+                r => (defined $r && $r ne '0'),
+        }, $class;
 }
 
 sub qs_html {
         my ($self, %over) = @_;
 
         if (keys %over) {
-                my $tmp = fields::new(ref($self));
-                %$tmp = %$self;
+                my $tmp = bless { %$self }, ref($self);
                 foreach my $k (keys %over) {
                         $tmp->{$k} = $over{$k};
                 }