mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-25 18:18:45 +02:00
minor cleanup
This commit is contained in:
@@ -50,13 +50,11 @@ public struct Where: FetchClause, QueryClause, DeleteClause, Hashable {
|
||||
*/
|
||||
public static func && (left: Where, right: Where?) -> Where {
|
||||
|
||||
if right != nil {
|
||||
return left && right!
|
||||
}
|
||||
else {
|
||||
if let right = right {
|
||||
|
||||
return left
|
||||
return left && right
|
||||
}
|
||||
return left
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,14 +65,12 @@ public struct Where: FetchClause, QueryClause, DeleteClause, Hashable {
|
||||
*/
|
||||
public static func && (left: Where?, right: Where) -> Where {
|
||||
|
||||
if left != nil {
|
||||
if let left = left {
|
||||
|
||||
return left && right
|
||||
}
|
||||
else {
|
||||
|
||||
return right
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Combines two `Where` predicates together using `OR` operator
|
||||
@@ -92,13 +88,11 @@ public struct Where: FetchClause, QueryClause, DeleteClause, Hashable {
|
||||
*/
|
||||
public static func || (left: Where, right: Where?) -> Where {
|
||||
|
||||
if right != nil {
|
||||
return left || right!
|
||||
}
|
||||
else {
|
||||
if let right = right {
|
||||
|
||||
return left
|
||||
return left || right
|
||||
}
|
||||
return left
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,14 +103,12 @@ public struct Where: FetchClause, QueryClause, DeleteClause, Hashable {
|
||||
*/
|
||||
public static func || (left: Where?, right: Where) -> Where {
|
||||
|
||||
if left != nil {
|
||||
if let left = left {
|
||||
|
||||
return left || right
|
||||
}
|
||||
else {
|
||||
|
||||
return right
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Inverts the predicate of a `Where` clause using `NOT` operator
|
||||
|
||||
Reference in New Issue
Block a user