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
a6f4ada5
Commit
a6f4ada5
authored
Mar 24, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant ChannelWrapper code; simplify RedisValue bool conversion (my bad)
parent
74f62580
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
85 deletions
+1
-85
StackExchange.Redis.csproj
StackExchange.Redis/StackExchange.Redis.csproj
+0
-1
ChannelWrapper.cs
StackExchange.Redis/StackExchange/Redis/ChannelWrapper.cs
+0
-83
RedisValue.cs
StackExchange.Redis/StackExchange/Redis/RedisValue.cs
+1
-1
No files found.
StackExchange.Redis/StackExchange.Redis.csproj
View file @
a6f4ada5
...
...
@@ -89,7 +89,6 @@
<Compile
Include=
"StackExchange\Redis\Format.cs"
/>
<Compile
Include=
"StackExchange\Redis\IBatch.cs"
/>
<Compile
Include=
"StackExchange\Redis\IMultiMessage.cs"
/>
<Compile
Include=
"StackExchange\Redis\ChannelWrapper.cs"
/>
<Compile
Include=
"StackExchange\Redis\Order.cs"
/>
<Compile
Include=
"StackExchange\Redis\RedisBatch.cs"
/>
<Compile
Include=
"StackExchange\Redis\RedisCommand.cs"
/>
...
...
StackExchange.Redis/StackExchange/Redis/ChannelWrapper.cs
deleted
100644 → 0
View file @
74f62580
//using System;
//namespace StackExchange.Redis
//{
// /// <summary>
// /// Wraps and unwraps keyspaces automatically
// /// </summary>
// public interface IChannelWrapper
// {
// /// <summary>
// /// Encode a key (translates a vanilla key to a wrapped key)
// /// </summary>
// RedisValue Encode(RedisValue key);
// /// <summary>
// /// Decode a key (translates a wrapped key to a vanilla key)
// /// </summary>
// RedisValue Decode(RedisValue key);
// }
// /// <summary>
// /// Implements IKeyspaceWrapper using a prefix notation
// /// </summary>
// public class ChannelPrefixWrapper : IChannelWrapper
// {
// private readonly byte[] prefix;
// /// <summary>
// /// Create a new KeyspacePrefixWrapper instance
// /// </summary>
// /// <param name="prefix">The prefix to the keys</param>
// public ChannelPrefixWrapper(RedisValue prefix)
// {
// this.prefix = prefix;
// if(this.prefix != null && this.prefix.Length == 0)
// {
// this.prefix = null; // no need to do anything
// }
// }
// /// <summary>
// /// Encode a key (translates a vanilla key to a wrapped key)
// /// </summary>
// public virtual RedisValue Decode(RedisValue key)
// {
// if (prefix == null) return key;
// byte[] blob = key;
// if (blob == null || blob.Length == 0) return key; // preserve nulls
// if(AssertStarts(blob, prefix))
// {
// var result = new byte[blob.Length - prefix.Length];
// Buffer.BlockCopy(blob, prefix.Length, result, 0, result.Length);
// return result;
// }
// return key;
// }
// internal static bool AssertStarts(byte[] value, byte[] expected)
// {
// for (int i = 0; i < expected.Length; i++)
// {
// if (expected[i] != value[i]) return false;
// }
// return true;
// }
// /// <summary>
// /// Decode a key (translates a wrapped key to a vanilla key)
// /// </summary>
// public virtual RedisValue Encode(RedisValue key)
// {
// if (prefix == null) return key;
// byte[] blob = key;
// if (blob == null) return key; // preserve nulls
// if (blob.Length == 0) return prefix;
// var result = new byte[prefix.Length + blob.Length];
// prefix.CopyTo(result, 0);
// blob.CopyTo(result, prefix.Length);
// return result;
// }
// }
//}
StackExchange.Redis/StackExchange/Redis/RedisValue.cs
View file @
a6f4ada5
...
...
@@ -274,7 +274,7 @@ internal RedisValue Assert()
/// </summary>
public
static
implicit
operator
RedisValue
(
bool
value
)
{
return
value
?
new
RedisValue
(
1
,
IntegerSentinel
)
:
new
RedisValue
(
0
,
IntegerSentinel
);
return
new
RedisValue
(
value
?
1
:
0
,
IntegerSentinel
);
}
/// <summary>
/// Creates a new RedisValue from a Boolean
...
...
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