Inbox names, coderepo nicks, git_dir values are used heavily
as hash keys by the read-only coderepo WWW pieces.
Relying on CoW for mutable scalars on newer Perl doesn't work
well since CoW for those scalars are limited to 256 CoW references
and blow past that number when mapping thousands of coderepos
and inboxes to each other. Instead, make the hash key up-front
and get the resulting string to point directly to the pointer
used by the hash key.
$git->{cgit_url} = $cgits = _array($cgits);
$self->{"$pfx.cgiturl"} = $cgits;
}
- $git->{nick} = $nick;
+ my %dedupe = ($nick => undef);
+ ($git->{nick}) = keys %dedupe;
$git;
}
}
return unless valid_foo_name($name, 'publicinbox');
- $ibx->{name} = $name;
+ my %dedupe = ($name => undef);
+ ($ibx->{name}) = keys %dedupe; # used as a key everywhere
$ibx->{-pi_cfg} = $self;
$ibx = PublicInbox::Inbox->new($ibx);
foreach (@{$ibx->{address}}) {
$git_dir =~ tr!/!/!s;
chop $git_dir;
# may contain {-tmp} field for File::Temp::Dir
- bless { git_dir => $git_dir }, $class
+ my %dedupe = ($git_dir => undef);
+ bless { git_dir => (keys %dedupe)[0] }, $class
}
sub git_path ($$) {