X Tutup
Skip to content

Commit 37d5fdd

Browse files
committed
Prepend element instead of appending and reversing
1 parent 6e402e2 commit 37d5fdd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bpython/history.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import os
2525
import stat
26-
from itertools import islice
26+
from itertools import islice, chain
2727
from typing import Iterable, Optional, List, TextIO
2828

2929
from .translations import _
@@ -100,7 +100,7 @@ def entry(self) -> str:
100100

101101
@property
102102
def entries_by_index(self) -> List[str]:
103-
return list(reversed(self.entries + [self.saved_line]))
103+
return list(chain((self.saved_line, ), reversed(self.entries)))
104104

105105
def find_match_backward(
106106
self, search_term: str, include_current: bool = False

0 commit comments

Comments
 (0)
X Tutup