Small improvement

This commit is contained in:
Gwendal Roué committed 2019-05-26 06:22:28 +02:00
1 parent 49a7b2091c
commit 1602a37d08
1 file changed
+2 -4
@@ -461,9 +461,7 @@ class NaiveLibraryManager {
func books(writtenBy author: Author) -> [Book] {
do {
return try dbQueue.read { db in
try Book
.filter(Book.Columns.authorId == author.id)
.fetchAll(db)
try author.books.fetchAll(db)
}
} catch {
return []
@@ -514,7 +512,7 @@ class ImprovedLibraryManager {
func books(writtenBy author: Author) throws -> [Book] {
return try dbQueue.read { db in
try Book.filter(Book.Columns.authorId == author.id).fetchAll(db)
try author.books.fetchAll(db)
}
}
}