Skip to content

Commit

Permalink
apacheGH-42087:refactored to remove build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
abandy committed Jun 10, 2024
1 parent 32db3dd commit 56b4426
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions swift/Arrow/Sources/Arrow/ArrowCExporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,18 @@ public class ArrowCExporter {
// deallocated
self.arrowData = arrowData
for arrowBuffer in arrowData.buffers {
data.append(arrowBuffer.rawPointer)
self.data.append(arrowBuffer.rawPointer)
}

self.buffers = UnsafeMutablePointer(mutating: data)
self.buffers = UnsafeMutablePointer<UnsafeRawPointer?>.allocate(capacity: data.count)
self.buffers.initialize(from: &data, count: data.count)
super.init()
}

deinit {
self.buffers.deinitialize(count: self.data.count)
self.buffers.deallocate()
}
}

private static var exportedData = [Int: ExportData]()
Expand Down
2 changes: 1 addition & 1 deletion swift/Arrow/Tests/ArrowTests/CodableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ final class CodableTests: XCTestCase {
switch result {
case .success(let rb):
let decoder = ArrowDecoder(rb)
var testClasses = try decoder.decode(TestClass.self)
let testClasses = try decoder.decode(TestClass.self)
for index in 0..<testClasses.count {
let testClass = testClasses[index]
XCTAssertEqual(testClass.propBool, index % 2 == 0 ? false : true)
Expand Down

0 comments on commit 56b4426

Please sign in to comment.