Use hasPrefix

This commit is contained in:
Matthias Neeracher 2014-12-03 16:41:39 +01:00 committed by Matthias Neeracher
parent f367d663ae
commit 2fd2a10432

View File

@ -13,7 +13,7 @@ class ASSerial {
let devices = NSFileManager.defaultManager().contentsOfDirectoryAtPath("/dev", error: nil)!
var cuDevs = [String]()
for dev in devices as [String] {
if dev.substringToIndex(dev.startIndex.successor().successor()) == "cu" {
if dev.hasPrefix("cu") {
cuDevs.append("/dev/"+dev)
}
}