Created
July 19, 2015 06:48
-
-
Save hachinobu/d8dac5fa3f9601c6a0f5 to your computer and use it in GitHub Desktop.
ArrayでremoveObject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
public func removeObject<T : Equatable>(object: T, inout fromArray array: [T]) | |
{ | |
var index = find(array, object) | |
array.removeAtIndex(index!) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment