Skip to content

Commit 24df2e5

Browse files
committed
Add inlinable notation to non-generic public methods as it may allow other compiler optimizations
feature/add-inlinable-notations-to-encourage-generic-specialization
1 parent 92c8546 commit 24df2e5

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

Sources/CoreDataRepository/CoreDataRepository+Batch.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Foundation
1111

1212
extension CoreDataRepository {
1313
/// Execute a NSBatchInsertRequest against the store.
14+
@inlinable
1415
public func insert(
1516
_ request: NSBatchInsertRequest,
1617
transactionAuthor: String? = nil
@@ -149,6 +150,7 @@ extension CoreDataRepository {
149150
}
150151

151152
/// Execute a NSBatchUpdateRequest against the store.
153+
@inlinable
152154
public func update(
153155
_ request: NSBatchUpdateRequest,
154156
transactionAuthor: String? = nil
@@ -238,6 +240,7 @@ extension CoreDataRepository {
238240
}
239241

240242
/// Execute a NSBatchDeleteRequest against the store.
243+
@inlinable
241244
public func delete(
242245
_ request: NSBatchDeleteRequest,
243246
transactionAuthor: String? = nil
@@ -256,6 +259,7 @@ extension CoreDataRepository {
256259
/// Delete from the store with a batch of unmanaged models.
257260
///
258261
/// This operation is non-atomic. Each instance may succeed or fail individually.
262+
@inlinable
259263
public func delete(
260264
urls: [URL],
261265
transactionAuthor: String? = nil
@@ -295,6 +299,7 @@ extension CoreDataRepository {
295299
}
296300

297301
/// Delete from the store with a batch of unmanaged models.
302+
@inlinable
298303
public func deleteAtomically(
299304
urls: [URL],
300305
transactionAuthor: String? = nil

Sources/CoreDataRepository/CoreDataRepository+CRUD.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ extension CoreDataRepository {
7575
}
7676

7777
/// Delete an instance from the store.
78+
@inlinable
7879
public func delete(
7980
_ url: URL,
8081
transactionAuthor: String? = nil

Sources/CoreDataRepository/UnmanagedReadOnlyModel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public protocol UnmanagedReadOnlyModel: Equatable {
8181
}
8282

8383
extension UnmanagedReadOnlyModel {
84+
@inlinable
8485
public static func managedFetchRequest() -> NSFetchRequest<ManagedModel> {
8586
NSFetchRequest<ManagedModel>(
8687
entityName: ManagedModel.entity().name ?? ManagedModel.entity()

0 commit comments

Comments
 (0)