user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH 0/2] some dead code elimination
@ 2021-03-16  8:48 Eric Wong
  2021-03-16  8:48 ` [PATCH 1/2] nntp: remove unused header_append method Eric Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Wong @ 2021-03-16  8:48 UTC (permalink / raw)
  To: meta

Eric Wong (2):
  nntp: remove unused header_append method
  git: drop async_prefetch method

 lib/PublicInbox/Git.pm  | 14 --------------
 lib/PublicInbox/NNTP.pm |  9 ---------
 2 files changed, 23 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] nntp: remove unused header_append method
  2021-03-16  8:48 [PATCH 0/2] some dead code elimination Eric Wong
@ 2021-03-16  8:48 ` Eric Wong
  2021-03-16  8:48 ` [PATCH 2/2] git: drop async_prefetch method Eric Wong
  2021-03-16  9:14 ` [PATCH 3/2] lock: remove new_tmp method Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2021-03-16  8:48 UTC (permalink / raw)
  To: meta

It was unused since 1bf653ad139bf7bb3d853ab0b5eae3eaa1b13a95
("nntp+www: drop List-* and Archived-At headers")
---
 lib/PublicInbox/NNTP.pm | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 18822d3b..f7d99913 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -409,15 +409,6 @@ sub cmd_quit ($) {
 	undef;
 }
 
-sub header_append ($$$) {
-	my ($hdr, $k, $v) = @_;
-	my @v = $hdr->header_raw($k);
-	foreach (@v) {
-		return if $v eq $_;
-	}
-	$hdr->header_set($k, @v, $v);
-}
-
 sub xref_by_tc ($$$) {
 	my ($xref, $pi_cfg, $smsg) = @_;
 	my $by_addr = $pi_cfg->{-by_addr};

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] git: drop async_prefetch method
  2021-03-16  8:48 [PATCH 0/2] some dead code elimination Eric Wong
  2021-03-16  8:48 ` [PATCH 1/2] nntp: remove unused header_append method Eric Wong
@ 2021-03-16  8:48 ` Eric Wong
  2021-03-16  9:14 ` [PATCH 3/2] lock: remove new_tmp method Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2021-03-16  8:48 UTC (permalink / raw)
  To: meta

That logic is inlined directly into git_async_prefetch
in GitAsyncCat and I don't see it being useful outside
of a DS event loop.
---
 lib/PublicInbox/Git.pm | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index e176921c..f680eb2f 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -467,20 +467,6 @@ sub cat_async ($$$;$) {
 	push(@$inflight, $oid, $cb, $arg);
 }
 
-sub async_prefetch {
-	my ($self, $oid, $cb, $arg) = @_;
-	if (my $inflight = $self->{inflight}) {
-		# we could use MAX_INFLIGHT here w/o the halving,
-		# but lets not allow one client to monopolize a git process
-		if (scalar(@$inflight) < int(MAX_INFLIGHT/2)) {
-			print { $self->{out} } $oid, "\n" or
-						$self->fail("write error: $!");
-			return push(@$inflight, $oid, $cb, $arg);
-		}
-	}
-	undef;
-}
-
 sub extract_cmt_time {
 	my ($bref, undef, undef, undef, $modified) = @_;
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/2] lock: remove new_tmp method
  2021-03-16  8:48 [PATCH 0/2] some dead code elimination Eric Wong
  2021-03-16  8:48 ` [PATCH 1/2] nntp: remove unused header_append method Eric Wong
  2021-03-16  8:48 ` [PATCH 2/2] git: drop async_prefetch method Eric Wong
@ 2021-03-16  9:14 ` Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2021-03-16  9:14 UTC (permalink / raw)
  To: meta

Unused as of commit dda8237aeb5722b3a48c31896d9b7398e50823f1
("lei_to_mail: prepare for worker offload") when we switched
to using the LeiOverview output lock.
---
 lib/PublicInbox/Lock.pm | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/lib/PublicInbox/Lock.pm b/lib/PublicInbox/Lock.pm
index c0c4c15c..76c3ffb2 100644
--- a/lib/PublicInbox/Lock.pm
+++ b/lib/PublicInbox/Lock.pm
@@ -8,7 +8,6 @@ use v5.10.1;
 use Fcntl qw(:flock :DEFAULT);
 use Carp qw(croak);
 use PublicInbox::OnDestroy;
-use File::Temp ();
 
 # we only acquire the flock if creating or reindexing;
 # PublicInbox::Import already has the lock on its own.
@@ -58,10 +57,4 @@ sub lock_for_scope_fast {
 	PublicInbox::OnDestroy->new(@single_pid, \&lock_release_fast, $self);
 }
 
-sub new_tmp {
-	my ($cls, $ident) = @_;
-	my $tmp = File::Temp->new("$ident.lock-XXXXXX", TMPDIR => 1);
-	bless { lock_path => $tmp->filename, tmp => $tmp }, $cls;
-}
-
 1;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-16  9:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16  8:48 [PATCH 0/2] some dead code elimination Eric Wong
2021-03-16  8:48 ` [PATCH 1/2] nntp: remove unused header_append method Eric Wong
2021-03-16  8:48 ` [PATCH 2/2] git: drop async_prefetch method Eric Wong
2021-03-16  9:14 ` [PATCH 3/2] lock: remove new_tmp method Eric Wong

Code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).