[meld] filediff: Remove explicit None comparisons for chunks
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] filediff: Remove explicit None comparisons for chunks
- Date: Sun, 31 Dec 2017 20:15:15 +0000 (UTC)
commit 2f26a421cd206f150bd9f1807faaf61bf8de256a
Author: Kai Willadsen <kai willadsen gmail com>
Date: Thu Dec 21 06:13:53 2017 +1000
filediff: Remove explicit None comparisons for chunks
There's really no point, so just use truthiness.
meld/filediff.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 4b372e32..75e153d6 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -433,10 +433,10 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
chunk2 = None
if self.num_panes == 3:
chunk2 = self.linediffer.get_chunk(chunk_id, 1, 2)
- left_mid_exists = chunk0 is not None and chunk0[1] != chunk0[2]
- left_exists = chunk0 is not None and chunk0[3] != chunk0[4]
- right_mid_exists = chunk2 is not None and chunk2[1] != chunk2[2]
- right_exists = chunk2 is not None and chunk2[3] != chunk2[4]
+ left_mid_exists = chunk0 and chunk0[1] != chunk0[2]
+ left_exists = chunk0 and chunk0[3] != chunk0[4]
+ right_mid_exists = chunk2 and chunk2[1] != chunk2[2]
+ right_exists = chunk2 and chunk2[3] != chunk2[4]
push_left = editable_left
push_right = editable_right
pull_left = editable and left_exists
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]