Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RealmSwift/Impl/RealmCollectionImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Realm
// The functions don't need to be documented here because Xcode/DocC inherit
// the documentation from the RealmCollection protocol definition, and jazzy
// excludes this file entirely.
@usableFromInline
internal protocol RealmCollectionImpl: RealmCollection where Index == Int, SubSequence == Slice<Self>, Iterator == RLMIterator<Element> {
var collection: RLMCollection { get }
init(collection: RLMCollection)
Expand Down
4 changes: 2 additions & 2 deletions RealmSwift/LinkingObjects.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ import Realm
self.propertyName = propertyName
self.handle = handle
}
internal init(collection: RLMCollection) {
@usableFromInline internal init(collection: RLMCollection) {
self.propertyName = ""
self.handle = RLMLinkingObjectsHandle(linkingObjects: collection as! RLMResults<AnyObject>)
}

internal var collection: RLMCollection {
@usableFromInline internal var collection: RLMCollection {
return handle?.results ?? RLMResults<AnyObject>.emptyDetached()
}

Expand Down
2 changes: 1 addition & 1 deletion RealmSwift/List.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class List<Element: RealmCollectionValue>: RLMSwiftCollectionBase,
internal var rlmArray: RLMArray<AnyObject> {
unsafeDowncast(collection, to: RLMArray<AnyObject>.self)
}
internal var collection: RLMCollection {
@usableFromInline internal var collection: RLMCollection {
_rlmCollection
}

Expand Down
2 changes: 1 addition & 1 deletion RealmSwift/MutableSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class MutableSet<Element: RealmCollectionValue>: RLMSwiftCollection
internal var rlmSet: RLMSet<AnyObject> {
unsafeDowncast(_rlmCollection, to: RLMSet.self)
}
internal var collection: RLMCollection {
@usableFromInline internal var collection: RLMCollection {
_rlmCollection
}

Expand Down
4 changes: 2 additions & 2 deletions RealmSwift/RealmCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1823,9 +1823,9 @@ extension RealmCollection {
collection directly.
*/
@frozen public struct AnyRealmCollection<Element: RealmCollectionValue>: RealmCollectionImpl {
internal let collection: RLMCollection
@usableFromInline internal let collection: RLMCollection
internal var lastAccessedNames: NSMutableArray?
internal init(collection: RLMCollection) {
@usableFromInline internal init(collection: RLMCollection) {
self.collection = collection
}

Expand Down
4 changes: 2 additions & 2 deletions RealmSwift/Results.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ extension Projection: KeypathSortable {}
Results instances cannot be directly instantiated.
*/
@frozen public struct Results<Element: RealmCollectionValue>: Equatable, RealmCollectionImpl {
internal let collection: RLMCollection
@usableFromInline internal let collection: RLMCollection

/// A human-readable description of the objects represented by the results.
public var description: String {
Expand All @@ -119,7 +119,7 @@ extension Projection: KeypathSortable {}

// MARK: Initializers

internal init(collection: RLMCollection) {
@usableFromInline internal init(collection: RLMCollection) {
self.collection = collection
}
internal init(_ collection: RLMCollection) {
Expand Down