[diffoscope] 01/01: Note another O(n^2) bug that I need to fix

Ximin Luo infinity0 at debian.org
Thu Nov 17 13:27:18 CET 2016

This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository diffoscope.

commit 9ec7ae3cfb3d6f993d13eeee16f829fb349f8d4c
Author: Ximin Luo <infinity0 at debian.org>
Date:   Thu Nov 17 13:26:41 2016 +0100

    Note another O(n^2) bug that I need to fix
 diffoscope/comparators/libarchive.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/diffoscope/comparators/libarchive.py b/diffoscope/comparators/libarchive.py
index 2565e1a..816bca2 100644
--- a/diffoscope/comparators/libarchive.py
+++ b/diffoscope/comparators/libarchive.py
@@ -173,6 +173,8 @@ class LibarchiveContainer(Archive):
         dest_path = os.path.join(dest_dir, dest_name)
         logger.debug('libarchive extracting %s to %s', member_name, dest_path)
         with libarchive.file_reader(self.source.path) as archive:
+            # FIXME: another O(n^2) lookup here, this will hit quite badly
+            # for large archives with a lot of small files.
             for entry in archive:
                 if entry.pathname == member_name:
                     logger.debug('entry found, writing %s', dest_path)

Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git

More information about the diffoscope mailing list