Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 7e1e8ca

Browse files
committed
remove duplicate SetEntry method
1 parent 218439b commit 7e1e8ca

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

src/ServiceStack.Redis/RedisClient.cs

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ public void SetEntry(string key, string value, TimeSpan expireIn)
130130
{
131131
base.Set(key, bytesValue, (int)expireIn.TotalSeconds);
132132
}
133-
else {
133+
else
134+
{
134135
base.Set(key, bytesValue, null, (long)expireIn.TotalMilliseconds);
135136
}
136137
}
@@ -149,6 +150,14 @@ public void SetEntryIfExists(string key, string value, TimeSpan expireIn)
149150
}
150151
}
151152

153+
public bool SetEntryIfNotExists(string key, string value)
154+
{
155+
if (value == null)
156+
throw new ArgumentNullException("value");
157+
158+
return SetNX(key, value.ToUtf8Bytes()) == Success;
159+
}
160+
152161
public void SetEntryIfNotExists(string key, string value, TimeSpan expireIn)
153162
{
154163
var bytesValue = value != null ? value.ToUtf8Bytes() : null;
@@ -232,23 +241,6 @@ public void SetAll(Dictionary<string, string> map)
232241
base.MSet(keyBytes, valBytes);
233242
}
234243

235-
public void SetEntry(string key, string value, TimeSpan expireIn)
236-
{
237-
var bytesValue = value != null
238-
? value.ToUtf8Bytes()
239-
: null;
240-
241-
SetEx(key, (int)expireIn.TotalSeconds, bytesValue);
242-
}
243-
244-
public bool SetEntryIfNotExists(string key, string value)
245-
{
246-
if (value == null)
247-
throw new ArgumentNullException("value");
248-
249-
return SetNX(key, value.ToUtf8Bytes()) == Success;
250-
}
251-
252244
public string GetValue(string key)
253245
{
254246
var bytes = Get(key);

0 commit comments

Comments
 (0)