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
905f7d7c
Commit
905f7d7c
authored
Sep 20, 2015
by
Jeremy Meng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use RegexOptions.Compiled if it is supported.
parent
8972ab72
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
737 additions
and
697 deletions
+737
-697
StackExchange.Redis.StrongName.csproj
StackExchange.Redis/StackExchange.Redis.StrongName.csproj
+1
-0
StackExchange.Redis.csproj
StackExchange.Redis/StackExchange.Redis.csproj
+1
-0
InternalRegexCompiledOption.cs
....Redis/StackExchange/Redis/InternalRegexCompiledOption.cs
+36
-0
ResultProcessor.cs
StackExchange.Redis/StackExchange/Redis/ResultProcessor.cs
+1
-1
ScriptParameterMapper.cs
...change.Redis/StackExchange/Redis/ScriptParameterMapper.cs
+1
-1
ServerEndPoint.cs
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
+695
-695
StackExchange.Redis_Net40.StrongName.csproj
...e.Redis_Net40/StackExchange.Redis_Net40.StrongName.csproj
+1
-0
StackExchange.Redis_Net40.csproj
StackExchange.Redis_Net40/StackExchange.Redis_Net40.csproj
+1
-0
No files found.
StackExchange.Redis/StackExchange.Redis.StrongName.csproj
View file @
905f7d7c
...
@@ -89,6 +89,7 @@
...
@@ -89,6 +89,7 @@
<Compile
Include=
"StackExchange\Redis\HashEntry.cs"
/>
<Compile
Include=
"StackExchange\Redis\HashEntry.cs"
/>
<Compile
Include=
"StackExchange\Redis\IConnectionMultiplexer.cs"
/>
<Compile
Include=
"StackExchange\Redis\IConnectionMultiplexer.cs"
/>
<Compile
Include=
"StackExchange\Redis\InternalErrorEventArgs.cs"
/>
<Compile
Include=
"StackExchange\Redis\InternalErrorEventArgs.cs"
/>
<Compile
Include=
"StackExchange\Redis\InternalRegexCompiledOption.cs"
/>
<Compile
Include=
"StackExchange\Redis\IProfiler.cs"
/>
<Compile
Include=
"StackExchange\Redis\IProfiler.cs"
/>
<Compile
Include=
"StackExchange\Redis\MigrateOptions.cs"
/>
<Compile
Include=
"StackExchange\Redis\MigrateOptions.cs"
/>
<Compile
Include=
"StackExchange\Redis\ProfileContextTracker.cs"
/>
<Compile
Include=
"StackExchange\Redis\ProfileContextTracker.cs"
/>
...
...
StackExchange.Redis/StackExchange.Redis.csproj
View file @
905f7d7c
...
@@ -83,6 +83,7 @@
...
@@ -83,6 +83,7 @@
<Compile
Include=
"StackExchange\Redis\HashEntry.cs"
/>
<Compile
Include=
"StackExchange\Redis\HashEntry.cs"
/>
<Compile
Include=
"StackExchange\Redis\IConnectionMultiplexer.cs"
/>
<Compile
Include=
"StackExchange\Redis\IConnectionMultiplexer.cs"
/>
<Compile
Include=
"StackExchange\Redis\InternalErrorEventArgs.cs"
/>
<Compile
Include=
"StackExchange\Redis\InternalErrorEventArgs.cs"
/>
<Compile
Include=
"StackExchange\Redis\InternalRegexCompiledOption.cs"
/>
<Compile
Include=
"StackExchange\Redis\IProfiler.cs"
/>
<Compile
Include=
"StackExchange\Redis\IProfiler.cs"
/>
<Compile
Include=
"StackExchange\Redis\MigrateOptions.cs"
/>
<Compile
Include=
"StackExchange\Redis\MigrateOptions.cs"
/>
<Compile
Include=
"StackExchange\Redis\ProfileContextTracker.cs"
/>
<Compile
Include=
"StackExchange\Redis\ProfileContextTracker.cs"
/>
...
...
StackExchange.Redis/StackExchange/Redis/InternalRegexCompiledOption.cs
0 → 100644
View file @
905f7d7c
#
if
NETCORE
using
System
;
#endif
using
System.Text.RegularExpressions
;
namespace
StackExchange.Redis
{
internal
static
class
InternalRegexCompiledOption
{
private
static
readonly
RegexOptions
RegexCompiledOption
;
static
InternalRegexCompiledOption
()
{
#if NETCORE
if
(!
Enum
.
TryParse
(
"Compiled"
,
out
RegexCompiledOption
))
RegexCompiledOption
=
RegexOptions
.
None
;
#else
RegexCompiledOption
=
RegexOptions
.
Compiled
;
#endif
}
/// <summary>
/// Gets the default <see cref="RegexOptions"/> to use.
/// <see cref="System.Text.RegularExpressions.RegexOptions.Compiled"/> option isn't available yet for dnxcore50.
/// 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
;
}
}
}
}
StackExchange.Redis/StackExchange/Redis/ResultProcessor.cs
View file @
905f7d7c
...
@@ -347,7 +347,7 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
...
@@ -347,7 +347,7 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
internal
sealed
class
ScriptLoadProcessor
:
ResultProcessor
<
byte
[
]>
internal
sealed
class
ScriptLoadProcessor
:
ResultProcessor
<
byte
[
]>
{
{
static
readonly
Regex
sha1
=
new
Regex
(
"^[0-9a-f]{40}$"
,
RegexOptions
.
Compiled
|
RegexOptions
.
IgnoreCase
);
static
readonly
Regex
sha1
=
new
Regex
(
"^[0-9a-f]{40}$"
,
InternalRegexCompiledOption
.
Default
|
RegexOptions
.
IgnoreCase
);
internal
static
bool
IsSHA1
(
string
script
)
internal
static
bool
IsSHA1
(
string
script
)
{
{
...
...
StackExchange.Redis/StackExchange/Redis/ScriptParameterMapper.cs
View file @
905f7d7c
...
@@ -23,7 +23,7 @@ public ScriptParameters(RedisKey[] keys, RedisValue[] args)
...
@@ -23,7 +23,7 @@ public ScriptParameters(RedisKey[] keys, RedisValue[] args)
}
}
}
}
static
readonly
Regex
ParameterExtractor
=
new
Regex
(
@"@(?<paramName> ([a-z]|_) ([a-z]|_|\d)*)"
,
RegexOptions
.
Compiled
|
RegexOptions
.
IgnoreCase
|
RegexOptions
.
IgnorePatternWhitespace
);
static
readonly
Regex
ParameterExtractor
=
new
Regex
(
@"@(?<paramName> ([a-z]|_) ([a-z]|_|\d)*)"
,
InternalRegexCompiledOption
.
Default
|
RegexOptions
.
IgnoreCase
|
RegexOptions
.
IgnorePatternWhitespace
);
static
string
[]
ExtractParameters
(
string
script
)
static
string
[]
ExtractParameters
(
string
script
)
{
{
var
ps
=
ParameterExtractor
.
Matches
(
script
);
var
ps
=
ParameterExtractor
.
Matches
(
script
);
...
...
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
View file @
905f7d7c
This diff is collapsed.
Click to expand it.
StackExchange.Redis_Net40/StackExchange.Redis_Net40.StrongName.csproj
View file @
905f7d7c
...
@@ -120,6 +120,7 @@
...
@@ -120,6 +120,7 @@
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IDatabaseAsync.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IDatabaseAsync.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IMultiMessage.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IMultiMessage.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\InternalErrorEventArgs.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\InternalErrorEventArgs.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\InternalRegexCompiledOption.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IProfiler.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IProfiler.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IRedis.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IRedis.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IRedisAsync.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IRedisAsync.cs"
/>
...
...
StackExchange.Redis_Net40/StackExchange.Redis_Net40.csproj
View file @
905f7d7c
...
@@ -117,6 +117,7 @@
...
@@ -117,6 +117,7 @@
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IDatabaseAsync.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IDatabaseAsync.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IMultiMessage.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IMultiMessage.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\InternalErrorEventArgs.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\InternalErrorEventArgs.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\InternalRegexCompiledOption.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IProfiler.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IProfiler.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IRedis.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IRedis.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IRedisAsync.cs"
/>
<Compile
Include=
"..\StackExchange.Redis\StackExchange\Redis\IRedisAsync.cs"
/>
...
...
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