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
4074eadd
Commit
4074eadd
authored
Oct 22, 2015
by
Jeremy Meng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace Array.ConvertAll() with Linq Select() calls.
parent
78e6335f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
Cluster.cs
StackExchange.Redis.Tests/Cluster.cs
+4
-4
MultiMaster.cs
StackExchange.Redis.Tests/MultiMaster.cs
+1
-1
Naming.cs
StackExchange.Redis.Tests/Naming.cs
+1
-1
Scripting.cs
StackExchange.Redis.Tests/Scripting.cs
+1
-1
No files found.
StackExchange.Redis.Tests/Cluster.cs
View file @
4074eadd
...
...
@@ -130,7 +130,7 @@ public void IntentionalWrongServer()
using
(
var
conn
=
Create
())
{
var
endpoints
=
conn
.
GetEndPoints
();
var
servers
=
Array
.
ConvertAll
(
endpoints
,
e
=>
conn
.
GetServer
(
e
));
var
servers
=
endpoints
.
Select
(
e
=>
conn
.
GetServer
(
e
));
var
key
=
Me
();
const
string
value
=
"abc"
;
...
...
@@ -368,7 +368,7 @@ public void Keys(string pattern, int pageSize)
using
(
var
conn
=
Create
(
allowAdmin
:
true
))
{
var
cluster
=
conn
.
GetDatabase
();
var
server
=
Array
.
ConvertAll
(
conn
.
GetEndPoints
(),
x
=>
conn
.
GetServer
(
x
)).
First
(
x
=>
!
x
.
IsSlave
);
var
server
=
conn
.
GetEndPoints
().
Select
(
x
=>
conn
.
GetServer
(
x
)).
First
(
x
=>
!
x
.
IsSlave
);
server
.
FlushAllDatabases
();
try
{
...
...
@@ -474,7 +474,7 @@ public void AccessRandomKeys()
Task
[]
send
=
new
Task
[
COUNT
];
int
index
=
0
;
var
servers
=
Array
.
ConvertAll
(
conn
.
GetEndPoints
(),
x
=>
conn
.
GetServer
(
x
));
var
servers
=
conn
.
GetEndPoints
().
Select
(
x
=>
conn
.
GetServer
(
x
));
foreach
(
var
server
in
servers
)
{
if
(!
server
.
IsSlave
)
...
...
@@ -600,7 +600,7 @@ public void MovedProfiling()
conn
.
RegisterProfiler
(
profiler
);
var
endpoints
=
conn
.
GetEndPoints
();
var
servers
=
Array
.
ConvertAll
(
endpoints
,
e
=>
conn
.
GetServer
(
e
));
var
servers
=
endpoints
.
Select
(
e
=>
conn
.
GetServer
(
e
));
conn
.
BeginProfiling
(
profiler
.
MyContext
);
var
db
=
conn
.
GetDatabase
();
...
...
StackExchange.Redis.Tests/MultiMaster.cs
View file @
4074eadd
...
...
@@ -22,7 +22,7 @@ public void CannotFlushSlave()
ConfigurationOptions
config
=
GetMasterSlaveConfig
();
using
(
var
conn
=
ConnectionMultiplexer
.
Connect
(
config
))
{
var
servers
=
Array
.
ConvertAll
(
conn
.
GetEndPoints
(),
e
=>
conn
.
GetServer
(
e
));
var
servers
=
conn
.
GetEndPoints
().
Select
(
e
=>
conn
.
GetServer
(
e
));
var
slave
=
servers
.
First
(
x
=>
x
.
IsSlave
);
slave
.
FlushDatabase
();
}
...
...
StackExchange.Redis.Tests/Naming.cs
View file @
4074eadd
...
...
@@ -148,7 +148,7 @@ public void CheckSyncAsyncMethodsMatch(Type from, Type to)
huntType
=
typeof
(
Task
<>).
MakeGenericType
(
method
.
ReturnType
);
}
var
pFrom
=
method
.
GetParameters
();
Type
[]
args
=
Array
.
ConvertAll
(
pFrom
,
x
=>
x
.
ParameterType
);
Type
[]
args
=
pFrom
.
Select
(
x
=>
x
.
ParameterType
).
ToArray
(
);
Assert
.
AreEqual
(
typeof
(
CommandFlags
),
args
.
Last
());
var
found
=
to
.
GetMethod
(
huntName
,
flags
,
null
,
method
.
CallingConvention
,
args
,
null
);
Assert
.
IsNotNull
(
found
,
"Found "
+
name
+
", no "
+
huntName
);
...
...
StackExchange.Redis.Tests/Scripting.cs
View file @
4074eadd
...
...
@@ -158,7 +158,7 @@ public void TestCallByHash()
var
db
=
conn
.
GetDatabase
();
RedisKey
[]
keys
=
{
Me
()
};
string
hexHash
=
string
.
Concat
(
Array
.
ConvertAll
(
hash
,
x
=>
x
.
ToString
(
"X2"
)));
string
hexHash
=
string
.
Concat
(
hash
.
Select
(
x
=>
x
.
ToString
(
"X2"
)));
Assert
.
AreEqual
(
"2BAB3B661081DB58BD2341920E0BA7CF5DC77B25"
,
hexHash
);
db
.
ScriptEvaluate
(
hexHash
,
keys
);
...
...
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