Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitabobko committed Sep 13, 2023
1 parent 5bb2f21 commit 38c74a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions src/model/TreeNodeEx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ extension TreeNode {
}

var workspace: Workspace {
if let workspace = self as? Workspace {
return workspace
} else {
return parent.workspace
}
self as? Workspace ?? parent.workspace
}

var anyChildWindowRecursive: MacWindow? {
Expand Down
6 changes: 1 addition & 5 deletions src/util/Maybe.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ extension Maybe {
}

static func from(_ value: T?) -> Maybe<T> {
if let value {
return Maybe.Just(value)
} else {
return Maybe.Nothing
}
value.flatMap { Maybe.Just($0) } ?? Maybe.Nothing
}
}
6 changes: 1 addition & 5 deletions src/util/OptionalEx.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
extension Optional {
func filterIsInstance<R>(of: R.Type) -> Optional<R> {
if let value = self as? R {
return value
} else {
return nil
}
self as? R ?? nil
}
}

0 comments on commit 38c74a0

Please sign in to comment.