Remove redundant code in Scanner.peek_token()
diff --git a/lib/yaml/scanner.py b/lib/yaml/scanner.py
index f86cb80..e7201b0 100644
--- a/lib/yaml/scanner.py
+++ b/lib/yaml/scanner.py
@@ -126,8 +126,7 @@
# Return the next token, but do not delete if from the queue.
while self.need_more_tokens():
self.fetch_more_tokens()
- if self.tokens:
- return self.tokens[0]
+ return self.tokens[0]
def get_token(self):
# Return the next token.
diff --git a/lib3/yaml/scanner.py b/lib3/yaml/scanner.py
index 3b49407..4ffe53a 100644
--- a/lib3/yaml/scanner.py
+++ b/lib3/yaml/scanner.py
@@ -126,8 +126,7 @@
# Return the next token, but do not delete if from the queue.
while self.need_more_tokens():
self.fetch_more_tokens()
- if self.tokens:
- return self.tokens[0]
+ return self.tokens[0]
def get_token(self):
# Return the next token.