summaryrefslogtreecommitdiff
path: root/alot/db/utils.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-12-20 10:46:53 -0800
committerDylan Baker <dylan@pnwbakers.com>2016-12-21 17:18:39 -0800
commite6fbfd5aab0d8fd9873ebe04f318180287872285 (patch)
tree8f000a71d388a2a803a5b02e4f870dadb4e6a988 /alot/db/utils.py
parent751b4fa7220f826e6ce1019cc332dbbbb0a7c79b (diff)
Use dict's iter methods
This patch replaces a number of uses of dict.items, dict.values, and dict.keys with their iterative siblings. The advantage of using the iterator version is that they don't copy the keys, values, or items, but simply return references. This reduces memory usage and may speed up the these operations a bit.
Diffstat (limited to 'alot/db/utils.py')
-rw-r--r--alot/db/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/alot/db/utils.py b/alot/db/utils.py
index 9ad1f98c..9c325247 100644
--- a/alot/db/utils.py
+++ b/alot/db/utils.py
@@ -249,7 +249,7 @@ def extract_headers(mail, headers=None):
"""
headertext = u''
if headers is None:
- headers = mail.keys()
+ headers = mail.iterkeys()
for key in headers:
value = u''
if key in mail: