mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-27 20:43:57 +00:00
fix typoes
This commit is contained in:
parent
17082c770f
commit
b2a63864aa
|
@ -23,14 +23,14 @@ public:
|
|||
};
|
||||
|
||||
template<class Enum>
|
||||
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<class Enum>
|
||||
|
@ -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<class Enum>
|
||||
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<class Enum>
|
||||
|
|
Loading…
Reference in a new issue