From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 88FD01FBCC for ; Mon, 1 Jun 2020 10:06:58 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 06/13] smsg: get rid of ->wrap initializer, too Date: Mon, 1 Jun 2020 10:06:50 +0000 Message-Id: <20200601100657.14700-7-e@yhbt.net> In-Reply-To: <20200601100657.14700-1-e@yhbt.net> References: <20200601100657.14700-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We'll just use `bless' like most current PublicInbox::Smsg callers. --- lib/PublicInbox/SearchIdx.pm | 2 +- lib/PublicInbox/Smsg.pm | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index eb228e6bba7..f10a9104e78 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -484,7 +484,7 @@ sub remove_by_oid { for (; $head != $tail; $head++) { my $docid = $head->get_docid; my $doc = $db->get_document($docid); - my $smsg = PublicInbox::Smsg->wrap($mid); + my $smsg = bless { mid => $mid }, 'PublicInbox::Smsg'; $smsg->load_expand($doc); if ($smsg->{blob} eq $oid) { push(@delete, $docid); diff --git a/lib/PublicInbox/Smsg.pm b/lib/PublicInbox/Smsg.pm index 8e2771274a1..446bca81b48 100644 --- a/lib/PublicInbox/Smsg.pm +++ b/lib/PublicInbox/Smsg.pm @@ -17,11 +17,6 @@ use PublicInbox::Address; use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp); use Time::Local qw(timegm); -sub wrap { - my ($class, $mid) = @_; - bless { mid => $mid }, $class; -} - sub get_val ($$) { my ($doc, $col) = @_; # sortable_unserialise is defined by PublicInbox::Search::load_xapian()