Skip to content

Commit

Permalink
Change function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdejong1 committed Sep 29, 2024
1 parent 745e643 commit 176b0c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ extension BasalProfileEditor {
}
}

func availableTimeIndices(forItemIndex: Int) -> [Int]
func availableTimeIndices(_ itemIndex: Int) -> [Int]
{
let usedIndicesByOtherItems = items.filter { $0 != items[forItemIndex] }.map(\.timeIndex)
let usedIndicesByOtherItems = items.filter { $0 != items[itemIndex] }.map(\.timeIndex)
return (0 ..< timeValues.count).filter { !usedIndicesByOtherItems.contains($0) }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ extension BasalProfileEditor {
.clipped()

Picker(selection: $state.items[index].timeIndex, label: EmptyView()) {
ForEach(state.availableTimeIndices(forItemIndex: index), id: \.self) { i in
ForEach(state.availableTimeIndices(index), id: \.self) { i in
Text(
self.dateFormatter
.string(from: Date(
Expand Down

0 comments on commit 176b0c1

Please sign in to comment.