Browse Source

use faster string comparer.

newNRvisualizers
Mike Krüger 14 years ago
parent
commit
2b5569dd47
  1. 2
      ICSharpCode.NRefactory/CSharp/Refactoring/ContextAction/ConvertDecToHex.cs
  2. 2
      ICSharpCode.NRefactory/CSharp/Refactoring/ContextAction/ConvertHexToDec.cs

2
ICSharpCode.NRefactory/CSharp/Refactoring/ContextAction/ConvertDecToHex.cs

@ -34,7 +34,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -34,7 +34,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
public bool IsValid (RefactoringContext context)
{
var pexpr = context.GetNode<PrimitiveExpression> ();
if (pexpr == null || pexpr.LiteralValue.StartsWith ("0X", System.StringComparison.InvariantCultureIgnoreCase))
if (pexpr == null || pexpr.LiteralValue.StartsWith ("0X", System.StringComparison.OrdinalIgnoreCase))
return false;
return (pexpr.Value is int) || (pexpr.Value is long) || (pexpr.Value is short) || (pexpr.Value is sbyte) ||
(pexpr.Value is uint) || (pexpr.Value is ulong) || (pexpr.Value is ushort) || (pexpr.Value is byte);

2
ICSharpCode.NRefactory/CSharp/Refactoring/ContextAction/ConvertHexToDec.cs

@ -34,7 +34,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -34,7 +34,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
public bool IsValid (RefactoringContext context)
{
var pexpr = context.GetNode<PrimitiveExpression> ();
if (pexpr == null || !pexpr.LiteralValue.StartsWith ("0X", System.StringComparison.InvariantCultureIgnoreCase))
if (pexpr == null || !pexpr.LiteralValue.StartsWith ("0X", System.StringComparison.OrdinalIgnoreCase))
return false;
return (pexpr.Value is int) || (pexpr.Value is long) || (pexpr.Value is short) || (pexpr.Value is sbyte) ||
(pexpr.Value is uint) || (pexpr.Value is ulong) || (pexpr.Value is ushort) || (pexpr.Value is byte);

Loading…
Cancel
Save