Skip to content

Commit

Permalink
printing predicates took too long. Removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
hectormatos2011 committed May 19, 2016
1 parent b923e26 commit 970b772
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Sources/PrediKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,14 @@ public extension NSPredicate {
- Parameters:
- type: The `Reflectable` class type that you'll be querying against. The type you supply here is what PrediKit will inspect to ensure the property names you specify in your includers are contained in that class' property list.
- file: Name of the file the function is being called from. Defaults to `#file`
- line: Number of the line the function is being called from. Defaults to `#line`
- builder: A closure that you use to generate includers that construct each subpredicate in the created `NSPredicate`
*/
convenience init<T: Reflectable>(_ type: T.Type, file: String = #file, line: Int = #line, @noescape builder: ((includeIf: PredicateBuilder<T>) -> Void)) {
convenience init<T: Reflectable>(_ type: T.Type, @noescape builder: ((includeIf: PredicateBuilder<T>) -> Void)) {
let predicateBuilder = PredicateBuilder(type: type)
builder(includeIf: predicateBuilder)

let predicateFormat = predicateBuilder.currentPredicate?.predicateFormat ?? predicateBuilder.predicateString
if let prettyFile = file.componentsSeparatedByString("/").last {
print("Predicate created in \(prettyFile) at line \(line):\n\(predicateFormat)")
}

if predicateFormat.isEmpty {
self.init(value: false)
} else {
Expand Down

0 comments on commit 970b772

Please sign in to comment.