Skip to content

Commit

Permalink
Missing struct tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
TimLariviere committed Oct 1, 2020
1 parent 5084420 commit 7eccc49
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Operation<'T>>.Shared.Rent(prevCollLength + coll.Length)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> ()
Expand All @@ -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) -> ()
Expand Down

0 comments on commit 7eccc49

Please sign in to comment.