Skip to content

Commit

Permalink
Merge pull request #1090 from kerams/ff
Browse files Browse the repository at this point in the history
Remove match struct
  • Loading branch information
edgarfgp authored Dec 15, 2024
2 parents 8bd2605 + 249ae69 commit 33ad120
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Fabulous/Array.fs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module ArraySlice =
module Array =
let inline appendOne (v: 'v) (arr: 'v array) =
let res = Array.zeroCreate(arr.Length + 1)
res[..arr.Length - 1] <- arr
res[.. arr.Length - 1] <- arr
res[arr.Length] <- v
res

Expand Down
8 changes: 4 additions & 4 deletions src/Fabulous/Components/Component.fs
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,28 @@ type Component
ValueSome(filteredAttrs) // skip the component data

let scalars =
match struct (rootWidget.ScalarAttributes, componentScalars) with
match rootWidget.ScalarAttributes, componentScalars with
| ValueNone, ValueNone -> ValueNone
| ValueSome attrs, ValueNone
| ValueNone, ValueSome attrs -> ValueSome attrs
| ValueSome widgetAttrs, ValueSome componentAttrs -> ValueSome(Array.append componentAttrs widgetAttrs)

let widgets =
match struct (rootWidget.WidgetAttributes, componentWidget.WidgetAttributes) with
match rootWidget.WidgetAttributes, componentWidget.WidgetAttributes with
| ValueNone, ValueNone -> ValueNone
| ValueSome attrs, ValueNone
| ValueNone, ValueSome attrs -> ValueSome attrs
| ValueSome widgetAttrs, ValueSome componentAttrs -> ValueSome(Array.append componentAttrs widgetAttrs)

let widgetColls =
match struct (rootWidget.WidgetCollectionAttributes, componentWidget.WidgetCollectionAttributes) with
match rootWidget.WidgetCollectionAttributes, componentWidget.WidgetCollectionAttributes with
| ValueNone, ValueNone -> ValueNone
| ValueSome attrs, ValueNone
| ValueNone, ValueSome attrs -> ValueSome attrs
| ValueSome widgetAttrs, ValueSome componentAttrs -> ValueSome(Array.append componentAttrs widgetAttrs)

let environments =
match struct (rootWidget.EnvironmentAttributes, componentWidget.EnvironmentAttributes) with
match rootWidget.EnvironmentAttributes, componentWidget.EnvironmentAttributes with
| ValueNone, ValueNone -> ValueNone
| ValueSome attrs, ValueNone
| ValueNone, ValueSome attrs -> ValueSome attrs
Expand Down
2 changes: 1 addition & 1 deletion src/Fabulous/Components/ComponentContext.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type ComponentContext(initialSize: int) =
if values.Length < count then
let newLength = max (values.Length * 2) count
let newArray = Array.zeroCreate newLength
newArray[..values.Length - 1] <- values
newArray[.. values.Length - 1] <- values
values <- newArray

member this.TryGetValue<'T>(key: int) =
Expand Down

0 comments on commit 33ad120

Please sign in to comment.