[llvm] r324945 - Simplify switch statement (NFC)
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 12 14:09:57 PST 2018
Author: adrian
Date: Mon Feb 12 14:09:57 2018
New Revision: 324945
URL: http://llvm.org/viewvc/llvm-project?rev=324945&view=rev
Log:
Simplify switch statement (NFC)
Modified:
llvm/trunk/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp
Modified: llvm/trunk/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp?rev=324945&r1=324944&r2=324945&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp Mon Feb 12 14:09:57 2018
@@ -21,11 +21,9 @@ static cl::opt<cl::boolOrDefault>
cl::init(cl::BOU_UNSET));
bool WithColor::colorsEnabled(raw_ostream &OS) {
- switch (UseColor) {
- case cl::BOU_UNSET: return OS.has_colors();
- case cl::BOU_TRUE: return true;
- case cl::BOU_FALSE: return false;
- }
+ if (UseColor == cl::BOU_UNSET)
+ return OS.has_colors();
+ return UseColor == cl::BOU_TRUE;
}
WithColor::WithColor(raw_ostream &OS, enum HighlightColor Type) : OS(OS) {
More information about the llvm-commits
mailing list