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
0b597044
Commit
0b597044
authored
Jul 03, 2016
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RegexOptions.Compiled is back
parent
056a6e44
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
36 deletions
+3
-36
InternalRegexCompiledOption.cs
....Redis/StackExchange/Redis/InternalRegexCompiledOption.cs
+0
-33
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
+1
-1
No files found.
StackExchange.Redis/StackExchange/Redis/InternalRegexCompiledOption.cs
deleted
100644 → 0
View file @
056a6e44
using
System.Text.RegularExpressions
;
#if CORE_CLR
using
System
;
#endif
namespace
StackExchange.Redis
{
/// <summary>
/// Credits to Sam Harwell https://github.com/dotnet/corefx/issues/340#issuecomment-120749951
/// </summary>
internal
static
class
InternalRegexCompiledOption
{
static
InternalRegexCompiledOption
()
{
#if CORE_CLR
RegexOptions
tmp
;
if
(!
Enum
.
TryParse
(
"Compiled"
,
out
tmp
))
tmp
=
RegexOptions
.
None
;
Default
=
tmp
;
#else
Default
=
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
;
}
}
}
StackExchange.Redis/StackExchange/Redis/ResultProcessor.cs
View file @
0b597044
...
...
@@ -347,7 +347,7 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
internal
sealed
class
ScriptLoadProcessor
:
ResultProcessor
<
byte
[
]>
{
static
readonly
Regex
sha1
=
new
Regex
(
"^[0-9a-f]{40}$"
,
InternalRegexCompiledOption
.
Default
|
RegexOptions
.
IgnoreCase
);
static
readonly
Regex
sha1
=
new
Regex
(
"^[0-9a-f]{40}$"
,
RegexOptions
.
Compiled
|
RegexOptions
.
IgnoreCase
);
internal
static
bool
IsSHA1
(
string
script
)
{
...
...
StackExchange.Redis/StackExchange/Redis/ScriptParameterMapper.cs
View file @
0b597044
...
...
@@ -23,7 +23,7 @@ public ScriptParameters(RedisKey[] keys, RedisValue[] args)
}
}
static
readonly
Regex
ParameterExtractor
=
new
Regex
(
@"@(?<paramName> ([a-z]|_) ([a-z]|_|\d)*)"
,
InternalRegexCompiledOption
.
Default
|
RegexOptions
.
IgnoreCase
|
RegexOptions
.
IgnorePatternWhitespace
);
static
readonly
Regex
ParameterExtractor
=
new
Regex
(
@"@(?<paramName> ([a-z]|_) ([a-z]|_|\d)*)"
,
RegexOptions
.
Compiled
|
RegexOptions
.
IgnoreCase
|
RegexOptions
.
IgnorePatternWhitespace
);
static
string
[]
ExtractParameters
(
string
script
)
{
var
ps
=
ParameterExtractor
.
Matches
(
script
);
...
...
StackExchange.Redis/StackExchange/Redis/ServerEndPoint.cs
View file @
0b597044
...
...
@@ -25,7 +25,7 @@ internal sealed partial class ServerEndPoint : IDisposable
{
internal
volatile
ServerEndPoint
Master
;
internal
volatile
ServerEndPoint
[]
Slaves
=
NoSlaves
;
private
static
readonly
Regex
nameSanitizer
=
new
Regex
(
"[^!-~]"
,
InternalRegexCompiledOption
.
Default
);
private
static
readonly
Regex
nameSanitizer
=
new
Regex
(
"[^!-~]"
,
RegexOptions
.
Compiled
);
private
static
readonly
ServerEndPoint
[]
NoSlaves
=
new
ServerEndPoint
[
0
];
private
readonly
EndPoint
endpoint
;
...
...
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