rename buffer mutating methods

This commit is contained in:
2024-10-30 04:27:03 -05:00
parent bb505acce1
commit f52a4147b8

View File

@@ -36,7 +36,7 @@ public struct Buffer<T>: ~Copyable {
try buffer.map(transform) try buffer.map(transform)
} }
@inlinable public func mutateEach(_ body: (Int, inout T) throws -> Void) rethrows { @inlinable public func mapInPlace(_ body: (Int, inout T) throws -> Void) rethrows {
for i in 0 ..< buffer.count { for i in 0 ..< buffer.count {
try body(i, &buffer[i]) try body(i, &buffer[i])
} }
@@ -52,7 +52,7 @@ public protocol ComplexType {
extension Complex: ComplexType {} extension Complex: ComplexType {}
public extension Buffer where T: ComplexType { public extension Buffer where T: ComplexType {
@inlinable public func mutateEachSwapLast(_ body: (Int, inout T) throws -> Void) rethrows { @inlinable func mapInPlaceSwapLast(_ body: (Int, inout T) throws -> Void) rethrows {
for i in 0 ..< buffer.count { for i in 0 ..< buffer.count {
try body(i, &buffer[i]) try body(i, &buffer[i])
} }