Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
1a4903ba
Commit
1a4903ba
authored
Dec 06, 2014
by
luberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #111: HashSet with RedisValue.EmptyString do not work as ""
Simple reorder of static field init order fixes this issue.
parent
d994b7ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
Hashes.cs
MigratedBookSleeveTestSuite/Hashes.cs
+13
-4
RedisValue.cs
StackExchange.Redis/StackExchange/Redis/RedisValue.cs
+3
-3
No files found.
MigratedBookSleeveTestSuite/Hashes.cs
View file @
1a4903ba
...
@@ -178,8 +178,13 @@ public void TestGet()
...
@@ -178,8 +178,13 @@ public void TestGet()
var
val2
=
conn
.
HashGetAsync
(
"hashkey"
,
"field"
);
var
val2
=
conn
.
HashGetAsync
(
"hashkey"
,
"field"
);
var
set2
=
conn
.
HashSetAsync
(
"hashkey"
,
"field-blob"
,
Encoding
.
UTF8
.
GetBytes
(
"value3"
));
var
set2
=
conn
.
HashSetAsync
(
"hashkey"
,
"field-blob"
,
Encoding
.
UTF8
.
GetBytes
(
"value3"
));
var
val3
=
conn
.
HashGetAsync
(
"hashkey"
,
"field-blob"
);
var
val3
=
conn
.
HashGetAsync
(
"hashkey"
,
"field-blob"
);
var
set3
=
conn
.
HashSetAsync
(
"hashkey"
,
"empty_type1"
,
""
);
var
val4
=
conn
.
HashGetAsync
(
"hashkey"
,
"empty_type1"
);
var
set4
=
conn
.
HashSetAsync
(
"hashkey"
,
"empty_type2"
,
RedisValue
.
EmptyString
);
var
val5
=
conn
.
HashGetAsync
(
"hashkey"
,
"empty_type2"
);
Assert
.
AreEqual
(
null
,
(
string
)
val0
.
Result
);
Assert
.
AreEqual
(
null
,
(
string
)
val0
.
Result
);
Assert
.
AreEqual
(
true
,
set0
.
Result
);
Assert
.
AreEqual
(
true
,
set0
.
Result
);
Assert
.
AreEqual
(
"value1"
,
(
string
)
val1
.
Result
);
Assert
.
AreEqual
(
"value1"
,
(
string
)
val1
.
Result
);
...
@@ -187,8 +192,12 @@ public void TestGet()
...
@@ -187,8 +192,12 @@ public void TestGet()
Assert
.
AreEqual
(
"value2"
,
(
string
)
val2
.
Result
);
Assert
.
AreEqual
(
"value2"
,
(
string
)
val2
.
Result
);
Assert
.
AreEqual
(
true
,
set2
.
Result
);
Assert
.
AreEqual
(
true
,
set2
.
Result
);
Assert
.
AreEqual
(
"value3"
,
(
string
)
val3
.
Result
);
Assert
.
AreEqual
(
"value3"
,
(
string
)
val3
.
Result
);
Assert
.
AreEqual
(
true
,
set3
.
Result
);
Assert
.
AreEqual
(
""
,
(
string
)
val4
.
Result
);
Assert
.
AreEqual
(
true
,
set4
.
Result
);
Assert
.
AreEqual
(
""
,
(
string
)
val5
.
Result
);
}
}
}
}
[
Test
]
[
Test
]
...
...
StackExchange.Redis/StackExchange/Redis/RedisValue.cs
View file @
1a4903ba
...
@@ -8,14 +8,14 @@ namespace StackExchange.Redis
...
@@ -8,14 +8,14 @@ namespace StackExchange.Redis
/// </summary>
/// </summary>
public
struct
RedisValue
:
IEquatable
<
RedisValue
>,
IComparable
<
RedisValue
>,
IComparable
,
IConvertible
public
struct
RedisValue
:
IEquatable
<
RedisValue
>,
IComparable
<
RedisValue
>,
IComparable
,
IConvertible
{
{
internal
static
readonly
RedisValue
[]
EmptyArray
=
new
RedisValue
[
0
];
internal
static
readonly
RedisValue
[]
EmptyArray
=
new
RedisValue
[
0
];
static
readonly
byte
[]
EmptyByteArr
=
new
byte
[
0
];
private
static
readonly
RedisValue
private
static
readonly
RedisValue
@null
=
new
RedisValue
(
0
,
null
),
@null
=
new
RedisValue
(
0
,
null
),
emptyString
=
new
RedisValue
(
0
,
EmptyByteArr
);
emptyString
=
new
RedisValue
(
0
,
EmptyByteArr
);
static
readonly
byte
[]
EmptyByteArr
=
new
byte
[
0
];
private
static
readonly
byte
[]
IntegerSentinel
=
new
byte
[
0
];
private
static
readonly
byte
[]
IntegerSentinel
=
new
byte
[
0
];
private
readonly
byte
[]
valueBlob
;
private
readonly
byte
[]
valueBlob
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment