]> Sergey Matveev's repositories - public-inbox.git/blob - lib/PublicInbox/NoopFilter.pm
a97dbde6456fd558c896367207e26a1b34396661
[public-inbox.git] / lib / PublicInbox / NoopFilter.pm
1 # Copyright (C) 2020 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3
4 package PublicInbox::NoopFilter;
5 use strict;
6
7 sub new { bless \(my $self = ''), __PACKAGE__ }
8
9 # noop workalike for PublicInbox::GzipFilter methods
10 sub translate {
11         my $self = $_[0];
12         my $ret = $$self .= ($_[1] // '');
13         $$self = '';
14         $ret;
15 }
16
17 sub zmore {
18         ${$_[0]} .= $_[1];
19         undef;
20 }
21
22 sub zflush { translate($_[0], $_[1]) }
23
24 1;