Commit 157abb43 authored by Nick Craver's avatar Nick Craver

C#6 Cleanup

parent 5abe60bf
......@@ -10,15 +10,13 @@ namespace StackExchange.Redis
/// </summary>
internal static class InternalRegexCompiledOption
{
private static readonly RegexOptions RegexCompiledOption;
static InternalRegexCompiledOption()
{
#if CORE_CLR
if (!Enum.TryParse("Compiled", out RegexCompiledOption))
RegexCompiledOption = RegexOptions.None;
#else
RegexCompiledOption = RegexOptions.Compiled;
Default = RegexOptions.Compiled;
#endif
}
......@@ -28,12 +26,6 @@ static InternalRegexCompiledOption()
/// This returns <see cref="System.Text.RegularExpressions.RegexOptions.Compiled"/> if it is supported;
/// <see cref="System.Text.RegularExpressions.RegexOptions.None"/> otherwise.
/// </summary>
public static RegexOptions Default
{
get
{
return RegexCompiledOption;
}
}
public static RegexOptions Default { get; }
}
}
......@@ -2367,7 +2367,7 @@ public StringGetWithExpiryMessage(int db, CommandFlags flags, RedisCommand ttlCo
{
this.ttlCommand = ttlCommand;
}
public override string CommandAndKey { get { return ttlCommand + "+" + RedisCommand.GET + " " + (string)Key; } }
public override string CommandAndKey => ttlCommand + "+" + RedisCommand.GET + " " + (string)Key;
public IEnumerable<Message> GetMessages(PhysicalConnection connection)
{
......
......@@ -174,10 +174,7 @@ internal static RedisResult TryCreate(PhysicalConnection connection, RawResult r
internal abstract string[] AsStringArray();
private sealed class ArrayRedisResult : RedisResult
{
public override bool IsNull
{
get { return value == null; }
}
public override bool IsNull => value == null;
private readonly RedisResult[] value;
public ArrayRedisResult(RedisResult[] value)
{
......
......@@ -44,15 +44,11 @@ public ResultBox(object stateOrCompletionSource)
{
this.stateOrCompletionSource = stateOrCompletionSource;
}
public object AsyncState
{
get
{
return stateOrCompletionSource is TaskCompletionSource<T>
? ((TaskCompletionSource<T>)stateOrCompletionSource).Task.AsyncState
: stateOrCompletionSource;
}
}
public object AsyncState =>
stateOrCompletionSource is TaskCompletionSource<T>
? ((TaskCompletionSource<T>) stateOrCompletionSource).Task.AsyncState
: stateOrCompletionSource;
public static ResultBox<T> Get(object stateOrCompletionSource)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment