From 96bd9ab0c3f03018f90551e685d896bf1743fd36 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Fri, 5 Feb 2016 10:58:56 +0100 Subject: [PATCH] use StringComparison.Ordinal for dyn updates in bindings --- src/GraphicObjects/GraphicObject.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index b9b142c0..f32ac30e 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -913,6 +913,9 @@ namespace Crow } resolved.Add (b); } + + MethodInfo stringEquals = typeof(string).GetMethod + ("Compare", new Type[3] {typeof(string), typeof(string), typeof(StringComparison)}); //group;only one dynMethods by target (valuechanged event source) //changed value name tested in switch IEnumerable groupedByTarget = resolved.GroupBy (g => g.Target.Instance, g => g, (k, g) => g.ToArray ()); @@ -924,10 +927,6 @@ namespace Crow DynamicMethod dm = null; ILGenerator il = null; - MethodInfo stringEquals = typeof(string).GetMethod - ("op_Equality", new Type[2] {typeof(string), typeof(string)}); - - System.Reflection.Emit.Label[] jumpTable = null; System.Reflection.Emit.Label endMethod = new System.Reflection.Emit.Label(); @@ -1018,8 +1017,9 @@ namespace Crow il.Emit (OpCodes.Ldstr, b.Target.Member.Name); else il.Emit (OpCodes.Ldstr, b.Expression.Split('/').LastOrDefault()); + il.Emit (OpCodes.Ldc_I4_4);//StringComparison.Ordinal il.Emit (OpCodes.Callvirt, stringEquals); - il.Emit (OpCodes.Brtrue, jumpTable[i]); + il.Emit (OpCodes.Brfalse, jumpTable[i]); i++; } -- 2.47.3