Files
Memola/Memola/Utilies/Extensions/Array++.swift
2024-07-06 14:20:31 +07:00

18 lines
277 B
Swift

//
// Array++.swift
// Memola
//
// Created by Dscyre Scotti on 5/4/24.
//
import Foundation
extension Array {
mutating func append(_ element: Element, capacity: Int) {
if count >= capacity {
remove(at: 0)
}
append(element)
}
}