0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::util: Limit iteration.

This commit is contained in:
Jason Volk 2019-08-23 15:52:58 -07:00
parent e39a0807a2
commit a2541e3627

View file

@ -219,7 +219,7 @@ ircd::util::pretty_nanoseconds(const mutable_buffer &out,
size_t i(0), pos(0); size_t i(0), pos(0);
long double val(ns); long double val(ns);
for(; val > std::get<1>(unit.at(pos)); ++pos) for(; val > std::get<1>(unit.at(pos)) && pos < unit.size() - 1; ++pos)
val /= std::get<1>(unit.at(pos)); val /= std::get<1>(unit.at(pos));
return fmt::sprintf return fmt::sprintf