From: Adam Simpkins <simpkins@fb.com>
Date: Thu, 29 Jun 2017 21:45:09 +0000 (-0700)
Subject: logging: support building with gcc-4.9
X-Git-Tag: v2017.07.03.00~17
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=22471d8d2e18bf2f9ddc6d30ae98bf36646c6041;p=folly.git

logging: support building with gcc-4.9

Summary:
Versions of gcc prior to 5.x only support C++11 constexpr functions, and
require that they consist of only a single return statement.

This updates isLogLevelFatal() to meet those requirements so that it can still
be compiled with gcc 4.9.

Reviewed By: ikobzar

Differential Revision: D5350304

fbshipit-source-id: 2a9c256236c484f8c3d5f83690fde8b7333aa4fc
---

diff --git a/folly/experimental/logging/LogLevel.h b/folly/experimental/logging/LogLevel.h
index 7ce01e66..75f401b1 100644
--- a/folly/experimental/logging/LogLevel.h
+++ b/folly/experimental/logging/LogLevel.h
@@ -122,10 +122,7 @@ std::ostream& operator<<(std::ostream& os, LogLevel level);
  * Returns true if and only if a LogLevel is fatal.
  */
 inline constexpr bool isLogLevelFatal(LogLevel level) {
-  if (folly::kIsDebug) {
-    return level >= LogLevel::DFATAL;
-  } else {
-    return level >= LogLevel::FATAL;
-  }
+  return folly::kIsDebug ? (level >= LogLevel::DFATAL)
+                         : (level >= LogLevel::FATAL);
 }
 }