]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options: s/boost::lexical_cast/std::stoull/
authorKefu Chai <kchai@redhat.com>
Sun, 27 Jun 2021 01:47:26 +0000 (09:47 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 27 Jun 2021 04:25:01 +0000 (12:25 +0800)
we should use standard library for more well defined behavior, and
less dependencies on 3rd party libraries.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/options.cc

index 8ad93c01a0733672017aa30da850a7daa23fa251..ac760e3491d6c63c14100bfa04f22736bb9fb70d 100644 (file)
@@ -210,8 +210,8 @@ int Option::parse_value(
     }
   } else if (type == Option::TYPE_MILLISECS) {
     try {
-      *out = std::chrono::milliseconds(boost::lexical_cast<uint64_t>(val));
-    } catch (const boost::bad_lexical_cast& e) {
+      *out = std::chrono::milliseconds(std::stoull(val));
+    } catch (const std::logic_error& e) {
       *error_message = e.what();
       return -EINVAL;
     }