From: Hakan Çelik Date: Mon, 28 Sep 2020 19:55:35 +0000 (+0300) Subject: Fix unnecessary if checks (#1728) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/172c0a78facd8f938629f216c95507bbfeddfe5e?ds=inline;hp=82c1f871d07e9c6334b5fb0bf089273a08ffd195 Fix unnecessary if checks (#1728) --- diff --git a/src/black/__init__.py b/src/black/__init__.py index 9af5801..24e9d4e 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -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