From: Joel Rosdahl Date: Thu, 30 Jul 2020 06:25:29 +0000 (+0200) Subject: Remove redundant check in parse_duration after f93c55832ee3 X-Git-Tag: v4.0~254 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5521f03281512de88900ca71cb4bacf3e9c37ad4;p=thirdparty%2Fccache.git Remove redundant check in parse_duration after f93c55832ee3 --- diff --git a/src/Util.cpp b/src/Util.cpp index e6c02e07b..452104bb5 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -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