diff options
author | Eric Wong <e@80x24.org> | 2015-09-30 21:00:19 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-09-30 21:09:18 +0000 |
commit | 709a1979302ef5dbb40babb84821b079868490a1 (patch) | |
tree | d38f9785c0ffebc1f36e3d7916ca75467e2fe8e9 /lib/PublicInbox/Hval.pm | |
parent | ebf564bad83e0c160b5088c7aaa9862d47735226 (diff) | |
download | public-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/Hval.pm')
-rw-r--r-- | lib/PublicInbox/Hval.pm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/PublicInbox/Hval.pm b/lib/PublicInbox/Hval.pm index e0ec6305..9fbe616f 100644 --- a/lib/PublicInbox/Hval.pm +++ b/lib/PublicInbox/Hval.pm @@ -5,7 +5,6 @@ package PublicInbox::Hval; use strict; use warnings; -use fields qw(raw href); use Encode qw(find_encoding); use URI::Escape qw(uri_escape_utf8); use PublicInbox::MID qw/mid_clean/; @@ -14,14 +13,14 @@ my $enc_ascii = find_encoding('us-ascii'); sub new { my ($class, $raw, $href) = @_; - my $self = fields::new($class); # we never care about leading/trailing whitespace $raw =~ s/\A\s*//; $raw =~ s/\s*\z//; - $self->{raw} = $raw; - $self->{href} = defined $href ? $href : $raw; - $self; + bless { + raw => $raw, + href => defined $href ? $href : $raw, + }, $class; } sub new_msgid { |