This is an automated email from the ASF dual-hosted git repository.
twice pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 606ac903 Fix inconsistency between Set and ToString in OctalField
(#1151)
606ac903 is described below
commit 606ac90352a20dbcef94405930213834beb378ea
Author: Twice <[email protected]>
AuthorDate: Fri Dec 2 15:08:27 2022 +0800
Fix inconsistency between Set and ToString in OctalField (#1151)
---
src/config/config_type.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/config/config_type.h b/src/config/config_type.h
index 04b04a03..ad776f92 100644
--- a/src/config/config_type.h
+++ b/src/config/config_type.h
@@ -20,6 +20,8 @@
#pragma once
+#include <fmt/format.h>
+
#include <string>
#include <utility>
@@ -126,7 +128,7 @@ class OctalField : public ConfigField {
public:
OctalField(int *receiver, int n, int min, int max) : receiver_(receiver),
min_(min), max_(max) { *receiver_ = n; }
~OctalField() override = default;
- std::string ToString() override { return std::to_string(*receiver_); }
+ std::string ToString() override { return fmt::format("{:o}", *receiver_); }
Status ToNumber(int64_t *n) override {
*n = *receiver_;
return Status::OK();