[lintian] 01/01: L::SlidingWindow: Make new() a bit more concise
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 16044b00ee0d869485613726e8e3d2b034814d08
Author: Niels Thykier <niels@thykier.net>
Date: Sun Feb 16 15:22:16 2014 +0100
L::SlidingWindow: Make new() a bit more concise
Signed-off-by: Niels Thykier <niels@thykier.net>
---
lib/Lintian/SlidingWindow.pm | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/lib/Lintian/SlidingWindow.pm b/lib/Lintian/SlidingWindow.pm
index da66aca..23ed886 100644
--- a/lib/Lintian/SlidingWindow.pm
+++ b/lib/Lintian/SlidingWindow.pm
@@ -28,22 +28,18 @@ use Lintian::Util qw(strip);
sub new {
my ($class, $mode, $file, $blocksub) = @_;
- my $self = {};
-
- my $block = '';
-
open(my $handle, $mode, $file);
binmode($handle);
- $self->{'_handle'} = $handle;
- $self->{'_queue'} = ['', ''];
- $self->{'_block'} = '';
- $self->{'_blocksize'} = 4096;
- $self->{'_blocksub'} = defined($blocksub) ? $blocksub : undef;
- $self->{'_blocknumber'} = -1;
+ my $self = {
+ '_handle' => $handle,
+ '_queue' => [q{}, q{}],
+ '_blocksize' => 4096,
+ '_blocksub' => $blocksub,
+ '_blocknumber' => -1,
+ };
- bless($self, $class);
- return $self;
+ return bless($self, $class);
}
sub readwindow {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: