[meld] Move size comparison so that we don't repeat it in shallow_equal()
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Move size comparison so that we don't repeat it in shallow_equal()
- Date: Sat, 9 Feb 2013 22:19:01 +0000 (UTC)
commit ad52a31f635d51bb319234bd540b8bd3b1cb5e6c
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Feb 10 07:45:00 2013 +1000
Move size comparison so that we don't repeat it in shallow_equal()
meld/dirdiff.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 08e29fb..798eb9c 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -118,10 +118,6 @@ def _files_same(files, regexes, prefs):
if not all([stat.S_ISREG(s.mode) for s in stats]):
return Different
- # If there are no text filters, unequal sizes imply a difference
- if not regexes and not all_same([s.size for s in stats]):
- return Different
-
# Compare files superficially if the options tells us to
if prefs.dirdiff_shallow_comparison:
if all(s.shallow_equal(stats[0], prefs) for s in stats[1:]):
@@ -129,6 +125,10 @@ def _files_same(files, regexes, prefs):
else:
return Different
+ # If there are no text filters, unequal sizes imply a difference
+ if not regexes and not all_same([s.size for s in stats]):
+ return Different
+
# Check the cache before doing the expensive comparison
cache = _cache.get((files, regexes))
if cache and cache.stats == stats:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]