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
40498f55
Commit
40498f55
authored
Sep 25, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid implicit casts in RedisChannel prefix
parent
a378428f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
WrapperBase.cs
...edis/StackExchange/Redis/KeyspaceIsolation/WrapperBase.cs
+1
-1
RedisKey.cs
StackExchange.Redis/StackExchange/Redis/RedisKey.cs
+12
-8
No files found.
StackExchange.Redis/StackExchange/Redis/KeyspaceIsolation/WrapperBase.cs
View file @
40498f55
...
...
@@ -754,7 +754,7 @@ protected RedisValue[] SortGetToInner(RedisValue[] outer)
protected
RedisChannel
ToInner
(
RedisChannel
outer
)
{
return
this
.
Prefix
+
outer
;
return
RedisKey
.
Concatenate
((
byte
[])
Prefix
,
(
byte
[])
outer
)
;
}
private
Func
<
RedisKey
,
RedisKey
>
mapFunction
;
...
...
StackExchange.Redis/StackExchange/Redis/RedisKey.cs
View file @
40498f55
...
...
@@ -201,18 +201,22 @@ internal void AssertNotNull()
/// </summary>
public
static
RedisKey
operator
+(
RedisKey
x
,
RedisKey
y
)
{
byte
[]
xVal
=
x
.
value
,
yVal
=
y
.
value
;
return
Concatenate
(
x
.
value
,
y
.
value
);
}
internal
static
byte
[]
Concatenate
(
byte
[]
x
,
byte
[]
y
)
{
// either null? yield the other; note this includes the "both null becomes null" case
if
(
x
Val
==
null
)
return
y
;
if
(
y
Val
==
null
)
return
x
;
if
(
x
==
null
)
return
y
;
if
(
y
==
null
)
return
x
;
// either empty? yield the other
if
(
x
Val
.
Length
==
0
)
return
y
;
if
(
y
Val
.
Length
==
0
)
return
x
;
if
(
x
.
Length
==
0
)
return
y
;
if
(
y
.
Length
==
0
)
return
x
;
byte
[]
result
=
new
byte
[
x
Val
.
Length
+
yVal
.
Length
];
Buffer
.
BlockCopy
(
x
Val
,
0
,
result
,
0
,
xVal
.
Length
);
Buffer
.
BlockCopy
(
y
Val
,
0
,
result
,
xVal
.
Length
,
yVal
.
Length
);
byte
[]
result
=
new
byte
[
x
.
Length
+
y
.
Length
];
Buffer
.
BlockCopy
(
x
,
0
,
result
,
0
,
x
.
Length
);
Buffer
.
BlockCopy
(
y
,
0
,
result
,
x
.
Length
,
y
.
Length
);
return
result
;
}
}
...
...
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