[meld] Add comment explaining the heuristic constant for discarded lines
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Add comment explaining the heuristic constant for discarded lines
- Date: Tue, 23 Mar 2010 22:38:45 +0000 (UTC)
commit cdbb29f6dca4754e127b8f6ce5423daea514dbd0
Author: Kai Willadsen <kai willadsen gmail com>
Date: Fri Feb 26 09:19:37 2010 +1000
Add comment explaining the heuristic constant for discarded lines
meld/matchers.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/meld/matchers.py b/meld/matchers.py
index 52375ef..fb81c24 100644
--- a/meld/matchers.py
+++ b/meld/matchers.py
@@ -115,6 +115,8 @@ class MyersSequenceMatcher(difflib.SequenceMatcher):
a2.append(a[i])
aindex[k] = i
k += 1
+ # We only use the optimised result if it's worthwhile. The constant
+ # represents a heuristic of how many lines constitute 'worthwhile'.
self.lines_discarded = m - j > 10 or n - k > 10
if self.lines_discarded:
a = a2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]