From ce9f7cba04cd0133ab48970a6daaf06b658e61d5 Mon Sep 17 00:00:00 2001 From: Patrick Rogers Date: Thu, 16 Jul 2020 18:26:57 -0400 Subject: [PATCH] Fixed a nullability specifier in enumerateIndexedValuesInColumn: Unlike objects, column values can be nil, so the block signature should reflect this. --- .../SecondaryIndex/Swift/YapDatabaseSecondaryIndex.swift | 4 ++-- .../SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/YapDatabase/Extensions/SecondaryIndex/Swift/YapDatabaseSecondaryIndex.swift b/YapDatabase/Extensions/SecondaryIndex/Swift/YapDatabaseSecondaryIndex.swift index c835fc3b2..574eadc46 100644 --- a/YapDatabase/Extensions/SecondaryIndex/Swift/YapDatabaseSecondaryIndex.swift +++ b/YapDatabase/Extensions/SecondaryIndex/Swift/YapDatabaseSecondaryIndex.swift @@ -89,9 +89,9 @@ extension YapDatabaseSecondaryIndexTransaction { return self.__enumerateRows(matching: query, using: enumBlock) } - public func iterateIndexedValues(inColumn column: String, matching query: YapDatabaseQuery, using block: (Any, inout Bool) -> Void) -> Bool { + public func iterateIndexedValues(inColumn column: String, matching query: YapDatabaseQuery, using block: (Any?, inout Bool) -> Void) -> Bool { - let enumBlock = {(value: Any, outerStop: UnsafeMutablePointer) -> Void in + let enumBlock = {(value: Any?, outerStop: UnsafeMutablePointer) -> Void in var innerStop = false block(value, &innerStop) diff --git a/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h b/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h index 7649de59a..942db430b 100644 --- a/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h +++ b/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h @@ -61,7 +61,7 @@ NS_REFINED_FOR_SWIFT; - (BOOL)enumerateIndexedValuesInColumn:(NSString *)column matchingQuery:(YapDatabaseQuery *)query - usingBlock:(void (^NS_NOESCAPE)(id indexedValue, BOOL *stop))block + usingBlock:(void (^NS_NOESCAPE)(__nullable id indexedValue, BOOL *stop))block NS_REFINED_FOR_SWIFT; /**