From 93ea6a2a6a455581b16cdddb24cbfaf1d895c036 Mon Sep 17 00:00:00 2001 From: Gregory Crosswhite Date: Wed, 29 Oct 2014 13:02:05 -0700 Subject: [PATCH] Made Journal.import_ more concise. --- jrnl/Journal.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/jrnl/Journal.py b/jrnl/Journal.py index 212cafab..a7b6521b 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -34,11 +34,7 @@ class Journal(object): return len(self.entries) def import_(self, other_journal_txt): - other_entries = self._parse(other_journal_txt) - entries_set = frozenset(self.entries) - for other_entry in other_entries: - if other_entry not in entries_set: - self.entries.append(other_entry) + self.entries = list(frozenset(self.entries) | frozenset(self._parse(other_journal_txt))) self.sort() def open(self, filename=None):