From 76bf8c0049cd5385c8c662d746e842a80f2a3d2f Mon Sep 17 00:00:00 2001 From: Imran Sobir Date: Sun, 26 Feb 2017 19:58:14 +0500 Subject: [PATCH] Convert history to list before converting to JSON. --- qutebrowser/browser/qutescheme.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index e5b581fca..fe22738f9 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -227,13 +227,13 @@ def qute_history(url): # apply an additional performance improvement in history_iter. # On my machine, this gets us down from 550ms to 72us with 500k old # items. - history = list(history_iter(start_time, reverse=True)) + history = history_iter(start_time, reverse=True) else: # On Python 3.4, we can't do that, so we'd need to copy the entire # history to a list. There, filter first and then reverse it here. history = reversed(list(history_iter(start_time, reverse=False))) - return 'text/html', json.dumps(history) + return 'text/html', json.dumps(list(history)) else: return 'text/html', jinja.render('history.html', title='History')