Avatar
ちなみになんですがRealmは確かそこら辺をLazyにやる仕組みが入ってたと思います (が、クエリでやれたらそっちの方が良いってのは同意です) クエリに関しては.where だった気がします
Results are lazily evaluated the first time they are accessed; they only run queries when the result of the query is requested. This means that chaining several temporary Results to sort and filter your data does not perform any unnecessary work processing the intermediate state.
https://github.com/realm/realm-swift/blob/45ea4a0ec4bb3161c807be0a9a4921161dbe60a2/RealmSwift/Results.swift#L103
(edited)
Realm is a mobile database: a replacement for Core Data & SQLite - realm-swift/Results.swift at 45ea4a0ec4bb3161c807be0a9a4921161dbe60a2 · realm/realm-swift