[lintian] 01/01: Improve speed of sliding windows
This is an automated email from the git hooks/post-receive script.
broucaries-guest pushed a commit to branch master
in repository lintian.
commit 4f3a7f139be8361bfe19c14754205ff715cb2e0c
Author: Bastien ROUCARIÈS <roucaries.bastien+debian@gmail.com>
Date: Fri Jul 31 10:21:21 2015 +0200
Improve speed of sliding windows
16_384 allow only a sliding windows for a lot of file
Signed-off-by: Bastien ROUCARIÈS <roucaries.bastien+debian@gmail.com>
---
checks/cruft.pm | 4 ++--
checks/files.pm | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/checks/cruft.pm b/checks/cruft.pm
index e0b2243..40d1f43 100644
--- a/checks/cruft.pm
+++ b/checks/cruft.pm
@@ -32,6 +32,7 @@ use v5.10;
# Half of the size used in the "sliding window" for detecting bad
# licenses like GFDL with invariant sections.
# NB: Keep in sync cruft-gfdl-fp-sliding-win/pre_build.
+# not less than 8192 for source missing
use constant BLOCKSIZE => 16_384;
use Lintian::Data;
@@ -819,8 +820,7 @@ sub full_text_check {
# some js file comments are really really long
my $sfd
- = Lintian::SlidingWindow->new($fd, \&lc_block,
- _is_javascript_but_not_minified($name) ? 8092 : 4096);
+ = Lintian::SlidingWindow->new($fd, \&lc_block, BLOCKSIZE);
my %licenseproblemhash;
# we try to read this file in block and use a sliding window
diff --git a/checks/files.pm b/checks/files.pm
index 19b4e13..ce90dfe 100644
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -30,6 +30,8 @@ use Lintian::Util qw(drain_pipe fail is_string_utf8_encoded open_gz
signal_number2name strip normalize_pkg_path);
use Lintian::SlidingWindow;
+use constant BLOCKSIZE => 16_384;
+
my $FONT_PACKAGES = Lintian::Data->new('files/fonts', qr/\s++/);
my $TRIPLETS = Lintian::Data->new('files/triplets', qr/\s++/);
my $LOCALE_CODES = Lintian::Data->new('files/locale-codes', qr/\s++/);
@@ -2038,7 +2040,7 @@ sub detect_privacy_breach {
my $fd = $file->open(':raw');
- my $sfd = Lintian::SlidingWindow->new($fd,sub { $_=lc($_); });
+ my $sfd = Lintian::SlidingWindow->new($fd,sub { $_=lc($_); },BLOCKSIZE);
while (my $block = $sfd->readwindow()) {
# try generic fragment tagging
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: