constinit -> constexpr for DisplayUnits
PiperOrigin-RevId: 674283690
Change-Id: I5ff9fd54af1175c2eb71fb942f10834f7be6bf9f
diff --git a/absl/time/duration.cc b/absl/time/duration.cc
index 8d0b66f..31b7bf2 100644
--- a/absl/time/duration.cc
+++ b/absl/time/duration.cc
@@ -718,13 +718,12 @@
int prec;
double pow10;
};
-ABSL_CONST_INIT const DisplayUnit kDisplayNano = {"ns", 2, 1e2};
-ABSL_CONST_INIT const DisplayUnit kDisplayMicro = {"us", 5, 1e5};
-ABSL_CONST_INIT const DisplayUnit kDisplayMilli = {"ms", 8, 1e8};
-ABSL_CONST_INIT const DisplayUnit kDisplaySec = {"s", 11, 1e11};
-ABSL_CONST_INIT const DisplayUnit kDisplayMin = {"m", -1, 0.0}; // prec ignored
-ABSL_CONST_INIT const DisplayUnit kDisplayHour = {"h", -1,
- 0.0}; // prec ignored
+constexpr DisplayUnit kDisplayNano = {"ns", 2, 1e2};
+constexpr DisplayUnit kDisplayMicro = {"us", 5, 1e5};
+constexpr DisplayUnit kDisplayMilli = {"ms", 8, 1e8};
+constexpr DisplayUnit kDisplaySec = {"s", 11, 1e11};
+constexpr DisplayUnit kDisplayMin = {"m", -1, 0.0}; // prec ignored
+constexpr DisplayUnit kDisplayHour = {"h", -1, 0.0}; // prec ignored
void AppendNumberUnit(std::string* out, int64_t n, DisplayUnit unit) {
char buf[sizeof("2562047788015216")]; // hours in max duration