Skip to content

Commit acfc017

Browse files
committed
Remove unnecessary diffs
Signed-off-by: dashjay <dashjwz@gmail.com>
1 parent b440283 commit acfc017

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/types/redis_hash.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <algorithm>
2626
#include <cctype>
2727
#include <cmath>
28-
#include <cstdint>
2928
#include <random>
3029
#include <utility>
3130

@@ -78,6 +77,7 @@ rocksdb::Status Hash::IncrBy(engine::Context &ctx, const Slice &user_key, const
7877
bool exists = false;
7978
int64_t old_value = 0;
8079
bool expired = false;
80+
8181
std::string ns_key = AppendNamespacePrefix(user_key);
8282

8383
HashMetadata metadata;
@@ -91,8 +91,8 @@ rocksdb::Status Hash::IncrBy(engine::Context &ctx, const Slice &user_key, const
9191
if (!s.ok() && !s.IsNotFound()) return s;
9292
if (s.ok()) {
9393
uint64_t expire_at = NoExpireTime;
94-
s = GetSubKeyExpireTimestampMS(ctx, user_key, field, metadata.version, &expire_at);
95-
if (!s.ok() && !s.IsNotFound()) return s;
94+
rocksdb::Status expire_s = GetSubKeyExpireTimestampMS(ctx, user_key, field, metadata.version, &expire_at);
95+
if (!expire_s.ok() && !expire_s.IsNotFound()) return expire_s;
9696
if (expire_at != NoExpireTime && expire_at < util::GetTimeStampMS()) {
9797
expired = true;
9898
old_value = 0;
@@ -137,6 +137,7 @@ rocksdb::Status Hash::IncrByFloat(engine::Context &ctx, const Slice &user_key, c
137137
bool exists = false;
138138
double old_value = 0;
139139
bool expired = false;
140+
140141
std::string ns_key = AppendNamespacePrefix(user_key);
141142

142143
HashMetadata metadata;
@@ -150,8 +151,8 @@ rocksdb::Status Hash::IncrByFloat(engine::Context &ctx, const Slice &user_key, c
150151
if (!s.ok() && !s.IsNotFound()) return s;
151152
if (s.ok()) {
152153
uint64_t expire_at = NoExpireTime;
153-
s = GetSubKeyExpireTimestampMS(ctx, user_key, field, metadata.version, &expire_at);
154-
if (!s.ok() && !s.IsNotFound()) return s;
154+
rocksdb::Status expire_s = GetSubKeyExpireTimestampMS(ctx, user_key, field, metadata.version, &expire_at);
155+
if (!expire_s.ok() && !expire_s.IsNotFound()) return expire_s;
155156
if (expire_at != NoExpireTime && expire_at < util::GetTimeStampMS()) {
156157
expired = true;
157158
old_value = 0;
@@ -308,6 +309,7 @@ rocksdb::Status Hash::MSet(engine::Context &ctx, const Slice &user_key, const st
308309
s = batch->PutLogData(log_data.Encode());
309310
if (!s.ok()) return s;
310311
std::unordered_set<std::string_view> field_set;
312+
311313
std::vector<rocksdb::Slice> keys;
312314
std::vector<rocksdb::Slice> origin_keys;
313315
std::vector<std::string> keys_encoded;
@@ -319,6 +321,7 @@ rocksdb::Status Hash::MSet(engine::Context &ctx, const Slice &user_key, const st
319321
if (!field_set.insert(it->field).second) {
320322
continue;
321323
}
324+
322325
origin_keys.emplace_back(it->field);
323326
keys_encoded.push_back(InternalKey(ns_key, it->field, metadata.version, storage_->IsSlotIdEncoded()).Encode());
324327
keys.emplace_back(keys_encoded.back());

src/types/redis_hash.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
#include <rocksdb/status.h>
2424

25-
#include <cstdint>
2625
#include <string>
2726
#include <vector>
2827

0 commit comments

Comments
 (0)