]> git.seodisparate.com - EN605.617.81.FA21_StephenSeo_DitheringProject/commitdiff
Minor efficiency fix/refactoring
authorStephen Seo <seo.disparate@gmail.com>
Sat, 4 Dec 2021 00:59:05 +0000 (09:59 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Sat, 4 Dec 2021 00:59:18 +0000 (09:59 +0900)
src/video.cc

index aac4f59d92b27f9f411b085f33c32bfcfe519175..7b4056d5efb17ffc672a5ecf65c5743fe1e1ea49 100644 (file)
@@ -472,10 +472,12 @@ std::tuple<bool, std::vector<AVFrame *>> 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";