diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/Collections.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/Collections.fs index 3be0fbf8c..5c306d7e5 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/Collections.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/Collections.fs @@ -255,12 +255,12 @@ module Collections = = match struct (prevCollOpt, collOpt) with - | ValueNone, ValueNone -> () - | ValueSome prevColl, ValueSome newColl when identical prevColl newColl -> () - | ValueSome prevColl, ValueSome newColl when prevColl <> null && newColl <> null && prevColl.Length = 0 && newColl.Length = 0 -> () - | ValueSome _, ValueNone -> targetColl.Clear() - | ValueSome _, ValueSome coll when (coll = null || coll.Length = 0) -> targetColl.Clear() - | _, ValueSome coll -> + | struct (ValueNone, ValueNone) -> () + | struct (ValueSome prevColl, ValueSome newColl) when identical prevColl newColl -> () + | struct (ValueSome prevColl, ValueSome newColl) when prevColl <> null && newColl <> null && prevColl.Length = 0 && newColl.Length = 0 -> () + | struct (ValueSome _, ValueNone) -> targetColl.Clear() + | struct (ValueSome _, ValueSome coll) when (coll = null || coll.Length = 0) -> targetColl.Clear() + | struct (_, ValueSome coll) -> let prevCollLength = (match prevCollOpt with ValueNone -> 0 | ValueSome c -> c.Length) let workingSet = ArrayPool>.Shared.Rent(prevCollLength + coll.Length) diff --git a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs index 593770812..afdbe101b 100644 --- a/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs +++ b/Fabulous.XamarinForms/src/Fabulous.XamarinForms.Core/ViewUpdaters.fs @@ -601,11 +601,11 @@ module ViewUpdaters = | struct (ValueSome prevValue, ValueSome currValue) -> match struct (prevValue, currValue) with - | Content.String prevStr, Content.String currStr when prevStr = currStr -> () - | Content.ViewElement prevVe, Content.ViewElement currVe when identical prevVe currVe -> () - | Content.ViewElement prevVe, Content.ViewElement currVe when canReuseView prevVe currVe -> currVe.UpdateIncremental(prevVe, target.Data) - | _, Content.String currStr -> target.Data <- PathGeometryConverter().ConvertFromInvariantString(currStr) :?> Xamarin.Forms.Shapes.Geometry - | _, Content.ViewElement currVe -> target.Data <- (currVe.Create() :?> Xamarin.Forms.Shapes.Geometry) + | struct (Content.String prevStr, Content.String currStr) when prevStr = currStr -> () + | struct (Content.ViewElement prevVe, Content.ViewElement currVe) when identical prevVe currVe -> () + | struct (Content.ViewElement prevVe, Content.ViewElement currVe) when canReuseView prevVe currVe -> currVe.UpdateIncremental(prevVe, target.Data) + | struct (_, Content.String currStr) -> target.Data <- PathGeometryConverter().ConvertFromInvariantString(currStr) :?> Xamarin.Forms.Shapes.Geometry + | struct (_, Content.ViewElement currVe) -> target.Data <- (currVe.Create() :?> Xamarin.Forms.Shapes.Geometry) | struct (ValueSome _, ValueNone) -> target.Data.ClearValue(Xamarin.Forms.Shapes.Path.DataProperty) | struct (ValueNone, ValueNone) -> () @@ -620,11 +620,11 @@ module ViewUpdaters = | struct (ValueSome prevValue, ValueSome currValue) -> match struct (prevValue, currValue) with - | Content.String prevStr, Content.String currStr when prevStr = currStr -> () - | Content.ViewElement prevVe, Content.ViewElement currVe when identical prevVe currVe -> () - | Content.ViewElement prevVe, Content.ViewElement currVe when canReuseView prevVe currVe -> currVe.UpdateIncremental(prevVe, target.RenderTransform) - | _, Content.String currStr -> target.RenderTransform <- TransformTypeConverter().ConvertFromInvariantString(currStr) :?> Xamarin.Forms.Shapes.Transform - | _, Content.ViewElement currVe -> target.RenderTransform <- (currVe.Create() :?> Xamarin.Forms.Shapes.Transform) + | struct (Content.String prevStr, Content.String currStr) when prevStr = currStr -> () + | struct (Content.ViewElement prevVe, Content.ViewElement currVe) when identical prevVe currVe -> () + | struct (Content.ViewElement prevVe, Content.ViewElement currVe) when canReuseView prevVe currVe -> currVe.UpdateIncremental(prevVe, target.RenderTransform) + | struct (_, Content.String currStr) -> target.RenderTransform <- TransformTypeConverter().ConvertFromInvariantString(currStr) :?> Xamarin.Forms.Shapes.Transform + | struct (_, Content.ViewElement currVe) -> target.RenderTransform <- (currVe.Create() :?> Xamarin.Forms.Shapes.Transform) | struct (ValueSome _, ValueNone) -> target.Data.ClearValue(Xamarin.Forms.Shapes.Path.DataProperty) | struct (ValueNone, ValueNone) -> ()