minor cleanup

This commit is contained in:
John Estropia
2017-07-04 12:21:46 +09:00
parent 961f39a806
commit a11915db12

View File

@@ -50,13 +50,11 @@ public struct Where: FetchClause, QueryClause, DeleteClause, Hashable {
*/ */
public static func && (left: Where, right: Where?) -> Where { public static func && (left: Where, right: Where?) -> Where {
if right != nil { if let right = right {
return left && right!
}
else {
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 { public static func && (left: Where?, right: Where) -> Where {
if left != nil { if let left = left {
return left && right return left && right
} }
else {
return right return right
} }
}
/** /**
Combines two `Where` predicates together using `OR` operator 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 { public static func || (left: Where, right: Where?) -> Where {
if right != nil { if let right = right {
return left || right!
}
else {
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 { public static func || (left: Where?, right: Where) -> Where {
if left != nil { if let left = left {
return left || right return left || right
} }
else {
return right return right
} }
}
/** /**
Inverts the predicate of a `Where` clause using `NOT` operator Inverts the predicate of a `Where` clause using `NOT` operator