From 709a1979302ef5dbb40babb84821b079868490a1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 30 Sep 2015 21:00:19 +0000 Subject: remove unnecessary fields usage 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. --- lib/PublicInbox/Hval.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/PublicInbox/Hval.pm') 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 { -- cgit v1.2.3-24-ge0c7