@@ -13,10 +13,10 @@ int64_t RedisClient::del(std::string key)
13
13
{
14
14
char *temp;
15
15
int len = redisFormatCommand (&temp, " DEL %s" , key.c_str ());
16
- std::string del (temp, len);
16
+ std::string sdel (temp, len);
17
17
free (temp);
18
18
19
- RedisReply r (m_db, del , REDIS_REPLY_INTEGER, true );
19
+ RedisReply r (m_db, sdel , REDIS_REPLY_INTEGER, true );
20
20
21
21
if (r.getContext ()->type != REDIS_REPLY_INTEGER)
22
22
throw std::runtime_error (" DEL operation failed" );
@@ -28,10 +28,10 @@ int64_t RedisClient::hdel(std::string key, std::string field)
28
28
{
29
29
char *temp;
30
30
int len = redisFormatCommand (&temp, " HDEL %s %s" , key.c_str (), field.c_str ());
31
- std::string hdel (temp, len);
31
+ std::string shdel (temp, len);
32
32
free (temp);
33
33
34
- RedisReply r (m_db, hdel , REDIS_REPLY_INTEGER, true );
34
+ RedisReply r (m_db, shdel , REDIS_REPLY_INTEGER, true );
35
35
36
36
if (r.getContext ()->type != REDIS_REPLY_INTEGER)
37
37
throw std::runtime_error (" HDEL operation failed" );
@@ -43,10 +43,10 @@ void RedisClient::hset(std::string key, std::string field, std::string value)
43
43
{
44
44
char *temp;
45
45
int len = redisFormatCommand (&temp, " HSET %s %s %s" , key.c_str (), field.c_str (), value.c_str ());
46
- std::string hset (temp, len);
46
+ std::string shset (temp, len);
47
47
free (temp);
48
48
49
- RedisReply r (m_db, hset , REDIS_REPLY_INTEGER, true );
49
+ RedisReply r (m_db, shset , REDIS_REPLY_INTEGER, true );
50
50
51
51
if (r.getContext ()->type != REDIS_REPLY_INTEGER)
52
52
throw std::runtime_error (" HSET operation failed" );
@@ -56,10 +56,10 @@ void RedisClient::set(std::string key, std::string value)
56
56
{
57
57
char *temp;
58
58
int len = redisFormatCommand (&temp, " SET %s %s" , key.c_str (), value.c_str ());
59
- std::string set (temp, len);
59
+ std::string sset (temp, len);
60
60
free (temp);
61
61
62
- RedisReply r (m_db, set , REDIS_REPLY_STATUS, true );
62
+ RedisReply r (m_db, sset , REDIS_REPLY_STATUS, true );
63
63
64
64
if (r.getContext ()->type != REDIS_REPLY_STATUS)
65
65
throw std::runtime_error (" SET operation failed" );
@@ -72,10 +72,10 @@ std::unordered_map<std::string, std::string> RedisClient::hgetall(std::string ke
72
72
char *temp;
73
73
int len = redisFormatCommand (&temp, " HGETALL %s" , key.c_str ());
74
74
75
- std::string incr (temp, len);
75
+ std::string sincr (temp, len);
76
76
free (temp);
77
77
78
- RedisReply r (m_db, incr , REDIS_REPLY_ARRAY, true );
78
+ RedisReply r (m_db, sincr , REDIS_REPLY_ARRAY, true );
79
79
80
80
if (r.getContext ()->type != REDIS_REPLY_ARRAY)
81
81
throw std::runtime_error (" HGETALL operation failed" );
@@ -95,10 +95,10 @@ std::vector<std::string> RedisClient::keys(std::string key)
95
95
char *temp;
96
96
int len = redisFormatCommand (&temp, " KEYS %s" , key.c_str ());
97
97
98
- std::string keys (temp, len);
98
+ std::string skeys (temp, len);
99
99
free (temp);
100
100
101
- RedisReply r (m_db, keys , REDIS_REPLY_ARRAY, true );
101
+ RedisReply r (m_db, skeys , REDIS_REPLY_ARRAY, true );
102
102
103
103
if (r.getContext ()->type != REDIS_REPLY_ARRAY)
104
104
throw std::runtime_error (" KEYS operation failed" );
@@ -116,10 +116,10 @@ int64_t RedisClient::incr(std::string key)
116
116
char *temp;
117
117
int len = redisFormatCommand (&temp, " INCR %s" , key.c_str ());
118
118
119
- std::string incr (temp, len);
119
+ std::string sincr (temp, len);
120
120
free (temp);
121
121
122
- RedisReply r (m_db, incr , REDIS_REPLY_INTEGER, true );
122
+ RedisReply r (m_db, sincr , REDIS_REPLY_INTEGER, true );
123
123
124
124
if (r.getContext ()->type != REDIS_REPLY_INTEGER)
125
125
throw std::runtime_error (" INCR command failed" );
@@ -132,10 +132,10 @@ int64_t RedisClient::decr(std::string key)
132
132
char *temp;
133
133
int len = redisFormatCommand (&temp, " DECR %s" , key.c_str ());
134
134
135
- std::string decr (temp, len);
135
+ std::string sdecr (temp, len);
136
136
free (temp);
137
137
138
- RedisReply r (m_db, decr , REDIS_REPLY_INTEGER, true );
138
+ RedisReply r (m_db, sdecr , REDIS_REPLY_INTEGER, true );
139
139
140
140
if (r.getContext ()->type != REDIS_REPLY_INTEGER)
141
141
throw std::runtime_error (" DECR command failed" );
@@ -148,12 +148,12 @@ std::shared_ptr<std::string> RedisClient::get(std::string key)
148
148
char *temp;
149
149
int len = redisFormatCommand (&temp, " GET %s" , key.c_str ());
150
150
151
- std::string get (temp, len);
151
+ std::string sget (temp, len);
152
152
free (temp);
153
153
154
154
redisReply *reply;
155
155
156
- redisAppendFormattedCommand (m_db->getContext (), get .c_str (), get .length ());
156
+ redisAppendFormattedCommand (m_db->getContext (), sget .c_str (), sget .length ());
157
157
redisGetReply (m_db->getContext (), (void **)&reply);
158
158
159
159
if (!reply)
@@ -182,12 +182,12 @@ std::shared_ptr<std::string> RedisClient::hget(std::string key, std::string fiel
182
182
char *temp;
183
183
int len = redisFormatCommand (&temp, " HGET %s %s" , key.c_str (), field.c_str ());
184
184
185
- std::string hget (temp, len);
185
+ std::string shget (temp, len);
186
186
free (temp);
187
187
188
188
redisReply *reply;
189
189
190
- redisAppendFormattedCommand (m_db->getContext (), hget .c_str (), hget .length ());
190
+ redisAppendFormattedCommand (m_db->getContext (), shget .c_str (), shget .length ());
191
191
redisGetReply (m_db->getContext (), (void **)&reply);
192
192
193
193
if (!reply)
@@ -222,10 +222,10 @@ int64_t RedisClient::rpush(std::string list, std::string item)
222
222
char *temp;
223
223
int len = redisFormatCommand (&temp, " RPUSH %s %s" , list.c_str (), item.c_str ());
224
224
225
- std::string rpush (temp, len);
225
+ std::string srpush (temp, len);
226
226
free (temp);
227
227
228
- RedisReply r (m_db, rpush , REDIS_REPLY_INTEGER, true );
228
+ RedisReply r (m_db, srpush , REDIS_REPLY_INTEGER, true );
229
229
230
230
if (r.getContext ()->type != REDIS_REPLY_INTEGER)
231
231
throw std::runtime_error (" RPUSH command failed" );
@@ -238,12 +238,12 @@ std::shared_ptr<std::string> RedisClient::blpop(std::string list, int timeout)
238
238
char *temp;
239
239
int len = redisFormatCommand (&temp, " BLPOP %s %d" , list.c_str (), timeout);
240
240
241
- std::string blpop (temp, len);
241
+ std::string sblpop (temp, len);
242
242
free (temp);
243
243
244
244
redisReply *reply;
245
245
246
- redisAppendFormattedCommand (m_db->getContext (), blpop .c_str (), blpop .length ());
246
+ redisAppendFormattedCommand (m_db->getContext (), sblpop .c_str (), sblpop .length ());
247
247
redisGetReply (m_db->getContext (), (void **)&reply);
248
248
249
249
if (!reply)
0 commit comments