mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
simplify dict key checks (SIM118)
This commit is contained in:
parent
af425c069f
commit
0bf661857d
@ -2531,7 +2531,7 @@ class DefinitionParser(BaseParser):
|
||||
while not self.eof:
|
||||
if (len(symbols) == 0 and self.current_char in end):
|
||||
break
|
||||
if self.current_char in brackets.keys():
|
||||
if self.current_char in brackets:
|
||||
symbols.append(brackets[self.current_char])
|
||||
elif len(symbols) > 0 and self.current_char == symbols[-1]:
|
||||
symbols.pop()
|
||||
|
@ -5754,7 +5754,7 @@ class DefinitionParser(BaseParser):
|
||||
while not self.eof:
|
||||
if (len(symbols) == 0 and self.current_char in end):
|
||||
break
|
||||
if self.current_char in brackets.keys():
|
||||
if self.current_char in brackets:
|
||||
symbols.append(brackets[self.current_char])
|
||||
elif len(symbols) > 0 and self.current_char == symbols[-1]:
|
||||
symbols.pop()
|
||||
|
@ -379,7 +379,7 @@ class BaseParser:
|
||||
while not self.eof:
|
||||
if len(symbols) == 0 and self.current_char in end:
|
||||
break
|
||||
if self.current_char in brackets.keys():
|
||||
if self.current_char in brackets:
|
||||
symbols.append(brackets[self.current_char])
|
||||
elif len(symbols) > 0 and self.current_char == symbols[-1]:
|
||||
symbols.pop()
|
||||
|
Loading…
Reference in New Issue
Block a user