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
bc481b6f
Commit
bc481b6f
authored
Nov 06, 2015
by
Jeremy Meng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert the HashTable => Dictionary<> change.
parent
5e68d069
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
LuaScript.cs
StackExchange.Redis/StackExchange/Redis/LuaScript.cs
+5
-6
No files found.
StackExchange.Redis/StackExchange/Redis/LuaScript.cs
View file @
bc481b6f
using
System
;
using
System.Collections
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
namespace
StackExchange.Redis
...
...
@@ -40,7 +39,7 @@ public sealed class LuaScript
bool
HasArguments
{
get
{
return
Arguments
!=
null
&&
Arguments
.
Length
>
0
;
}
}
Dictionary
<
Type
,
Func
<
object
,
RedisKey
?,
ScriptParameterMapper
.
ScriptParameters
>>
ParameterMappers
;
Hashtable
ParameterMappers
;
internal
LuaScript
(
string
originalScript
,
string
executableScript
,
string
[]
arguments
)
{
...
...
@@ -50,7 +49,7 @@ internal LuaScript(string originalScript, string executableScript, string[] argu
if
(
HasArguments
)
{
ParameterMappers
=
new
Dictionary
<
Type
,
Func
<
object
,
RedisKey
?,
ScriptParameterMapper
.
ScriptParameters
>>
();
ParameterMappers
=
new
Hashtable
();
}
}
...
...
@@ -110,17 +109,17 @@ internal void ExtractParameters(object ps, RedisKey? keyPrefix, out RedisKey[] k
if
(
ps
==
null
)
throw
new
ArgumentNullException
(
"ps"
,
"Script requires parameters"
);
var
psType
=
ps
.
GetType
();
var
mapper
=
ParameterMappers
[
psType
];
var
mapper
=
(
Func
<
object
,
RedisKey
?,
ScriptParameterMapper
.
ScriptParameters
>)
ParameterMappers
[
psType
];
if
(
ps
!=
null
&&
mapper
==
null
)
{
lock
(
ParameterMappers
)
{
mapper
=
ParameterMappers
[
psType
];
mapper
=
(
Func
<
object
,
RedisKey
?,
ScriptParameterMapper
.
ScriptParameters
>)
ParameterMappers
[
psType
];
if
(
mapper
==
null
)
{
string
missingMember
;
string
badMemberType
;
if
(!
ScriptParameterMapper
.
IsValidParameterHash
(
psType
,
this
,
out
missingMember
,
out
badMemberType
))
if
(!
ScriptParameterMapper
.
IsValidParameterHash
(
psType
,
this
,
out
missingMember
,
out
badMemberType
))
{
if
(
missingMember
!=
null
)
{
...
...
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