From 94096cab6cd5e00c8a36a4a2667bdb9acf43d01f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 27 Jun 2020 10:03:38 +0000 Subject: ds: remove fields.pm usage Since the removal of pseudo-hash support in Perl 5.10, the "fields" module no longer provides the space or speed benefits it did in 5.8. It also does not allow for compile-time checks, only run-time checks. To me, the extra developer overhead in maintaining "use fields" args has become a hassle. None of our non-DS-related code uses fields.pm, nor do any of our current dependencies. In fact, Danga::Socket (which DS was originally forked from) and its subclasses are the only fields.pm users I've ever encountered in the wild. Removing fields may make our code more approachable to other Perl hackers. So stop using fields.pm and locked hashes, but continue to document what fields do for non-trivial classes. --- lib/PublicInbox/DirIdle.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/DirIdle.pm') diff --git a/lib/PublicInbox/DirIdle.pm b/lib/PublicInbox/DirIdle.pm index ffceda66..fbbc9531 100644 --- a/lib/PublicInbox/DirIdle.pm +++ b/lib/PublicInbox/DirIdle.pm @@ -4,8 +4,7 @@ # Used by public-inbox-watch for Maildir (and possibly MH in the future) package PublicInbox::DirIdle; use strict; -use base 'PublicInbox::DS'; -use fields qw(inot); +use parent 'PublicInbox::DS'; use PublicInbox::Syscall qw(EPOLLIN EPOLLET); use PublicInbox::In2Tie; @@ -24,7 +23,7 @@ if ($^O eq 'linux' && eval { require Linux::Inotify2; 1 }) { sub new { my ($class, $dirs, $cb) = @_; - my $self = fields::new($class); + my $self = bless {}, $class; my $inot; if ($ino_cls) { $inot = $ino_cls->new or die "E: $ino_cls->new: $!"; -- cgit v1.2.3-24-ge0c7