mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-15 21:14:35 +02:00
Use fixed values for unchanging dict to replace split and for loops
This commit is contained in:
@@ -500,18 +500,14 @@ def scrollback_pager_history_size(x: str) -> int:
|
||||
return min(ans, 4096 * 1024 * 1024 - 1)
|
||||
|
||||
|
||||
# "single" for backwards compat
|
||||
url_style_map = {'none': 0, 'single': 1, 'straight': 1, 'double': 2, 'curly': 3, 'dotted': 4, 'dashed': 5}
|
||||
|
||||
|
||||
def url_style(x: str) -> int:
|
||||
# for backwards compat
|
||||
if x == 'single':
|
||||
x = 'straight'
|
||||
return url_style_map.get(x, url_style_map['curly'])
|
||||
|
||||
|
||||
url_style_map = {
|
||||
v: i for i, v in enumerate('none straight double curly dotted dashed'.split())
|
||||
}
|
||||
|
||||
|
||||
def url_prefixes(x: str) -> Tuple[str, ...]:
|
||||
return tuple(a.lower() for a in x.replace(',', ' ').split())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user