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
e734ab0a
Commit
e734ab0a
authored
Sep 19, 2015
by
Jeremy Meng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace Hashtable with Dictionary.
parent
1236e152
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
LuaScript.cs
StackExchange.Redis/StackExchange/Redis/LuaScript.cs
+5
-4
StackExchange.Redis_NetCore.csproj
...Exchange.Redis_NetCore/StackExchange.Redis_NetCore.csproj
+2
-0
project.json
StackExchange.Redis_NetCore/project.json
+3
-1
No files found.
StackExchange.Redis/StackExchange/Redis/LuaScript.cs
View file @
e734ab0a
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Concurrent
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
namespace
StackExchange.Redis
namespace
StackExchange.Redis
...
@@ -39,7 +40,7 @@ public sealed class LuaScript
...
@@ -39,7 +40,7 @@ public sealed class LuaScript
bool
HasArguments
{
get
{
return
Arguments
!=
null
&&
Arguments
.
Length
>
0
;
}
}
bool
HasArguments
{
get
{
return
Arguments
!=
null
&&
Arguments
.
Length
>
0
;
}
}
Hashtable
ParameterMappers
;
Dictionary
<
Type
,
Func
<
object
,
RedisKey
?,
ScriptParameterMapper
.
ScriptParameters
>>
ParameterMappers
;
internal
LuaScript
(
string
originalScript
,
string
executableScript
,
string
[]
arguments
)
internal
LuaScript
(
string
originalScript
,
string
executableScript
,
string
[]
arguments
)
{
{
...
@@ -49,7 +50,7 @@ internal LuaScript(string originalScript, string executableScript, string[] argu
...
@@ -49,7 +50,7 @@ internal LuaScript(string originalScript, string executableScript, string[] argu
if
(
HasArguments
)
if
(
HasArguments
)
{
{
ParameterMappers
=
new
Hashtable
();
ParameterMappers
=
new
Dictionary
<
Type
,
Func
<
object
,
RedisKey
?,
ScriptParameterMapper
.
ScriptParameters
>>
();
}
}
}
}
...
@@ -109,12 +110,12 @@ internal void ExtractParameters(object ps, RedisKey? keyPrefix, out RedisKey[] k
...
@@ -109,12 +110,12 @@ internal void ExtractParameters(object ps, RedisKey? keyPrefix, out RedisKey[] k
if
(
ps
==
null
)
throw
new
ArgumentNullException
(
"ps"
,
"Script requires parameters"
);
if
(
ps
==
null
)
throw
new
ArgumentNullException
(
"ps"
,
"Script requires parameters"
);
var
psType
=
ps
.
GetType
();
var
psType
=
ps
.
GetType
();
var
mapper
=
(
Func
<
object
,
RedisKey
?,
ScriptParameterMapper
.
ScriptParameters
>)
ParameterMappers
[
psType
];
var
mapper
=
ParameterMappers
[
psType
];
if
(
ps
!=
null
&&
mapper
==
null
)
if
(
ps
!=
null
&&
mapper
==
null
)
{
{
lock
(
ParameterMappers
)
lock
(
ParameterMappers
)
{
{
mapper
=
(
Func
<
object
,
RedisKey
?,
ScriptParameterMapper
.
ScriptParameters
>)
ParameterMappers
[
psType
];
mapper
=
ParameterMappers
[
psType
];
if
(
mapper
==
null
)
if
(
mapper
==
null
)
{
{
string
missingMember
;
string
missingMember
;
...
...
StackExchange.Redis_NetCore/StackExchange.Redis_NetCore.csproj
View file @
e734ab0a
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
<DefineConstants>
TRACE;DEBUG;NETCORE;
</DefineConstants>
<DefineConstants>
TRACE;DEBUG;NETCORE;
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<WarningLevel>
4
</WarningLevel>
<AllowUnsafeBlocks>
true
</AllowUnsafeBlocks>
</PropertyGroup>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<DebugType>
pdbonly
</DebugType>
<DebugType>
pdbonly
</DebugType>
...
@@ -33,6 +34,7 @@
...
@@ -33,6 +34,7 @@
<DefineConstants>
TRACE;NETCORE;
</DefineConstants>
<DefineConstants>
TRACE;NETCORE;
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<WarningLevel>
4
</WarningLevel>
<AllowUnsafeBlocks>
true
</AllowUnsafeBlocks>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<None
Include=
"project.json"
/>
<None
Include=
"project.json"
/>
...
...
StackExchange.Redis_NetCore/project.json
View file @
e734ab0a
...
@@ -5,7 +5,9 @@
...
@@ -5,7 +5,9 @@
},
},
"dependencies"
:
{
"dependencies"
:
{
"Microsoft.NETCore"
:
"5.0.0"
,
"Microsoft.NETCore"
:
"5.0.0"
,
"Microsoft.NETCore.Portable.Compatibility"
:
"1.0.0"
"Microsoft.NETCore.Portable.Compatibility"
:
"1.0.0"
,
"System.Collections"
:
"4.0.10"
,
"System.Reflection.Emit"
:
"4.0.0"
},
},
"frameworks"
:
{
"frameworks"
:
{
"dotnet"
:
{
"dotnet"
:
{
...
...
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