Skip to content

Commit 6d5bb0c

Browse files
committed
Initialize pointer
1 parent fdac655 commit 6d5bb0c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Sources/SQLite/Typed/CustomFunctions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public extension Connection {
217217

218218
let state: () -> UnsafeMutablePointer<T> = {
219219
let pointer = UnsafeMutablePointer<T>.allocate(capacity: 1)
220-
pointer.pointee = initialValue
220+
pointer.initialize(to: initialValue)
221221
return pointer
222222
}
223223

Tests/SQLiteTests/CustomAggregationTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class CustomAggregationTests: SQLiteTestCase {
105105
}
106106
db.createAggregation("myReduceSUM3", initialValue: initial, reduce: reduce, result: { $0 })
107107
let result = try! db.prepare("SELECT myReduceSUM3(email) AS s FROM users")
108+
108109
let i = result.columnNames.firstIndex(of: "s")!
109110
for row in result {
110111
let value = row[i] as? String

0 commit comments

Comments
 (0)