React to StringTokenizer changes.

This commit is contained in:
Cesar Blum Silveira 2016-01-29 13:42:36 -08:00
parent 26a14a25ab
commit b404d5c3de
2 changed files with 7 additions and 5 deletions

View File

@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
/// </summary>
public class EnvironmentTagHelper : TagHelper
{
private static readonly char NameSeparator = ',';
private static readonly char[] NameSeparator = new[] { ',' };
/// <summary>
/// Creates a new <see cref="EnvironmentTagHelper"/>.

View File

@ -29,6 +29,8 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal
private static readonly char[] ValidAttributeWhitespaceChars =
new[] { '\t', '\n', '\u000C', '\r', ' ' };
private static readonly PathComparer DefaultPathComparer = new PathComparer();
private static readonly char[] PatternSeparator = new[] { ',' };
private static readonly char[] PathSeparator = new[] { '/' };
private readonly FileProviderGlobbingDirectory _baseGlobbingDirectory;
/// <summary>
@ -124,7 +126,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal
return files;
}
var includeTokenizer = new StringTokenizer(include, ',');
var includeTokenizer = new StringTokenizer(include, PatternSeparator);
var includeEnumerator = includeTokenizer.GetEnumerator();
if (!includeEnumerator.MoveNext())
{
@ -144,7 +146,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal
if (!string.IsNullOrWhiteSpace(exclude))
{
var excludeTokenizer = new StringTokenizer(exclude, ',');
var excludeTokenizer = new StringTokenizer(exclude, PatternSeparator);
var trimmedExcludePatterns = new List<string>();
foreach (var excludePattern in excludeTokenizer)
{
@ -234,8 +236,8 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal
var yNoExt = yExtIndex >= 0 ? y.Substring(0, yExtIndex) : y;
var result = 0;
var xEnumerator = new StringTokenizer(xNoExt, '/').GetEnumerator();
var yEnumerator = new StringTokenizer(yNoExt, '/').GetEnumerator();
var xEnumerator = new StringTokenizer(xNoExt, PathSeparator).GetEnumerator();
var yEnumerator = new StringTokenizer(yNoExt, PathSeparator).GetEnumerator();
StringSegment xSegment;
StringSegment ySegment;
while (TryGetNextSegment(ref xEnumerator, out xSegment))