Skip to content

Commit

Permalink
Rename internal method
Browse files Browse the repository at this point in the history
  • Loading branch information
bradhowes committed Oct 6, 2021
1 parent c3ddc05 commit 6e07f10
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extension MIDIPacketList {
let packetsSize = (packets.map { $0.alignedByteSize }).reduce(0, +)
let listSize = MemoryLayout<MIDIPacketList>.size - MemoryLayout<MIDIPacket>.size + packetsSize

func OptionalMIDIPacketListAdd(_ packetListPtr: UnsafeMutablePointer<MIDIPacketList>,
func optionalMIDIPacketListAdd(_ packetListPtr: UnsafeMutablePointer<MIDIPacketList>,
_ curPacketPtr: UnsafeMutablePointer<MIDIPacket>,
_ packet: MIDIPacket) -> UnsafeMutablePointer<MIDIPacket>? {
return withUnsafeBytes(of: packet.data) { ptr in
Expand All @@ -78,7 +78,7 @@ extension MIDIPacketList {
let packetListPtr = bufferPtr.bindMemory(to: MIDIPacketList.self).baseAddress!
var curPacketPtr = MIDIPacketListInit(packetListPtr)
for packet in packets {
guard let newPacketPtr = OptionalMIDIPacketListAdd(packetListPtr, curPacketPtr, packet) else {
guard let newPacketPtr = optionalMIDIPacketListAdd(packetListPtr, curPacketPtr, packet) else {
fatalError()
}
curPacketPtr = newPacketPtr
Expand Down

0 comments on commit 6e07f10

Please sign in to comment.