Use more performant deletion

Co-authored-by: Fabio <788002+justdoit176@users.noreply.github.com>
This commit is contained in:
micahellison 2020-05-05 08:50:48 -07:00 committed by GitHub
parent 26ec7fc5c6
commit a60d3f9fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -236,9 +236,8 @@ class Journal:
def delete_entries(self, entries_to_delete):
"""Deletes specific entries from a journal."""
self.entries = [
entry for entry in self.entries if entry not in entries_to_delete
]
for entry in entries_to_delete:
self.entries.remove(entry)
def prompt_delete_entries(self):
"""Prompts for deletion of each of the entries in a journal.