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-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,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 805091FD47 for ; Sun, 12 Jan 2020 21:17:57 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 04/11] ds: remove Timer->cancel and Timer class+bless Date: Sun, 12 Jan 2020 21:17:49 +0000 Message-Id: <20200112211756.23100-5-e@yhbt.net> In-Reply-To: <20200112211756.23100-1-e@yhbt.net> References: <20200112211756.23100-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It doesn't seem needed at the moment, and we can re-add it in the future if needed. --- lib/PublicInbox/DS.pm | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index 3b9193b6..57c945f5 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -106,16 +106,13 @@ sub SetLoopTimeout { Add a timer to occur $seconds from now. $seconds may be fractional, but timers are not guaranteed to fire at the exact time you ask for. -Returns a timer object which you can call C<< $timer->cancel >> on if you need -to. - =cut sub add_timer ($$) { my ($secs, $coderef) = @_; my $fire_time = now() + $secs; - my $timer = bless [$fire_time, $coderef], "PublicInbox::DS::Timer"; + my $timer = [$fire_time, $coderef]; if (!@Timers || $fire_time >= $Timers[-1][0]) { push @Timers, $timer; @@ -693,12 +690,6 @@ sub not_idle_long { $exp_at > $now; } -package PublicInbox::DS::Timer; -# [$abs_float_firetime, $coderef]; -sub cancel { - $_[0][1] = undef; -} - 1; =head1 AUTHORS (Danga::Socket)