]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove redundant check in parse_duration after f93c55832ee3
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 30 Jul 2020 06:25:29 +0000 (08:25 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 30 Jul 2020 19:04:01 +0000 (21:04 +0200)
src/Util.cpp

index e6c02e07bbb694c5ed603122d6762fe976b7cc3a..452104bb56951a9db36a9748b376f6fa9044450a 100644 (file)
@@ -864,8 +864,7 @@ parse_duration(const std::string& duration)
       "invalid suffix (supported: d (day) and s (second)): \"{}\"", duration));
   }
 
-  const size_t end = factor == 0 ? duration.length() : duration.length() - 1;
-  return factor * parse_uint32(duration.substr(0, end));
+  return factor * parse_uint32(duration.substr(0, duration.length() - 1));
 }
 
 int