Fix unnecessary if checks (#1728)

This commit is contained in:
Hakan Çelik 2020-09-28 22:55:35 +03:00 committed by GitHub
parent 82c1f871d0
commit 172c0a78fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -859,9 +859,9 @@ def color_diff(contents: str) -> str:
for i, line in enumerate(lines):
if line.startswith("+++") or line.startswith("---"):
line = "\033[1;37m" + line + "\033[0m" # bold white, reset
if line.startswith("@@"):
elif line.startswith("@@"):
line = "\033[36m" + line + "\033[0m" # cyan, reset
if line.startswith("+"):
elif line.startswith("+"):
line = "\033[32m" + line + "\033[0m" # green, reset
elif line.startswith("-"):
line = "\033[31m" + line + "\033[0m" # red, reset