-// Copyright (C) 2021 Joel Rosdahl and other contributors
+// Copyright (C) 2021-2022 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
const auto reply = redis_command("EXISTS %s", key_string.c_str());
if (!reply) {
return nonstd::make_unexpected(reply.error());
- } else if ((*reply)->type == REDIS_REPLY_INTEGER && (*reply)->integer > 0) {
+ } else if ((*reply)->type != REDIS_REPLY_INTEGER) {
+ LOG("Unknown reply type: {}", (*reply)->type);
+ } else if ((*reply)->integer > 0) {
LOG("Entry {} already in Redis", key_string);
return false;
- } else {
- LOG("Unknown reply type: {}", (*reply)->type);
}
}