From 750e0d07bbc8103531aaade256a8d8e24ba8dc56 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sat, 4 Dec 2021 09:59:05 +0900 Subject: [PATCH] Minor efficiency fix/refactoring --- src/video.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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";