mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Use -1 as an initial value for the pos
This commit is contained in:
parent
e43c4e3cb1
commit
2e0c078e7c
@ -1,4 +1,3 @@
|
||||
import sys
|
||||
import abc
|
||||
import typing
|
||||
|
||||
@ -29,12 +28,12 @@ class ListCompleter(Completer):
|
||||
if o.startswith(start):
|
||||
self.options.append(o)
|
||||
self.options.sort()
|
||||
self.pos = sys.maxsize
|
||||
self.pos = -1
|
||||
|
||||
def cycle(self, forward: bool = True) -> str:
|
||||
if not self.options:
|
||||
return self.start
|
||||
if self.pos == sys.maxsize:
|
||||
if self.pos == -1:
|
||||
self.pos = 0 if forward else len(self.options) - 1
|
||||
else:
|
||||
delta = 1 if forward else -1
|
||||
|
Loading…
Reference in New Issue
Block a user