1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00
dragonflydb-dragonfly/server/config_flags.cc
2021-11-28 09:29:26 +02:00

19 lines
451 B
C++

// Copyright 2021, Roman Gershman. All rights reserved.
// See LICENSE for licensing terms.
//
#include "server/config_flags.h"
namespace dfly {
bool ValidateConfigEnum(const char* nm, const std::string& val, const ConfigEnum* ptr, unsigned len,
int* dest) {
for (unsigned i = 0; i < len; ++i) {
if (val == ptr[i].first) {
*dest = ptr[i].second;
return true;
}
}
return false;
}
} // namespace dfly