From b2a63864aa10b6c83292ec9ec3e8dd8bffe5d0f2 Mon Sep 17 00:00:00 2001 From: leipeng Date: Tue, 20 Sep 2022 14:07:17 +0800 Subject: [PATCH] fix typoes --- include/rocksdb/enum_reflection.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/rocksdb/enum_reflection.h b/include/rocksdb/enum_reflection.h index e5d46c2888..425ffa8885 100644 --- a/include/rocksdb/enum_reflection.h +++ b/include/rocksdb/enum_reflection.h @@ -23,14 +23,14 @@ public: }; template -Slice enum_name(Enum v, const char* unkown = "") { +Slice enum_name(Enum v, const char* unknown = "") { auto names = enum_all_names ((Enum*)0); auto values = enum_all_values((Enum*)0); for (size_t i = 0; i < names.second; ++i) { if (v == values[i]) return names.first[i]; } - return unkown; + return unknown; } template @@ -41,20 +41,20 @@ std::string enum_stdstr(Enum v) { if (v == values[i]) return names.first[i].ToString(); } - return "unkown:" + (sizeof(Enum) <= sizeof(int) + return "unknown:" + (sizeof(Enum) <= sizeof(int) ? std::to_string((int)v) : std::to_string((long)v)); } template -const char* enum_cstr(Enum v, const char* unkown = "") { +const char* enum_cstr(Enum v, const char* unknown = "") { auto names = enum_all_names ((Enum*)0); auto values = enum_all_values((Enum*)0); for (size_t i = 0; i < names.second; ++i) { if (v == values[i]) return names.first[i].data(); } - return unkown; + return unknown; } template