From: Stephen Seo Date: Sat, 4 Dec 2021 00:59:05 +0000 (+0900) Subject: Minor efficiency fix/refactoring X-Git-Url: https://git.seodisparate.com/stephenseo/static/gitweb.js?a=commitdiff_plain;h=750e0d07bbc8103531aaade256a8d8e24ba8dc56;p=EN605.617.81.FA21_StephenSeo_DitheringProject Minor efficiency fix/refactoring --- diff --git a/src/video.cc b/src/video.cc index aac4f59..7b4056d 100644 --- a/src/video.cc +++ b/src/video.cc @@ -472,10 +472,12 @@ std::tuple> Video::HandleDecodingPacket( if (output_as_pngs) { std::string out_name = "output_"; + unsigned int tens = 1; for (unsigned int i = 0; i < 9; ++i) { - if (frame_count_ < (unsigned int)std::pow(10, i)) { + if (frame_count_ < tens) { out_name += "0"; } + tens *= 10; } out_name += std::to_string(frame_count_); out_name += ".png";