fix some typos

This commit is contained in:
huangqiaobo
2014-09-05 18:52:54 +08:00
parent d5041cebca
commit 00ef4e6c14

View File

@ -682,10 +682,10 @@ protocolValue.simpleDescription
在尖括号里写一个名字来创建一个泛型函数或者类型。 在尖括号里写一个名字来创建一个泛型函数或者类型。
```swift ```swift
func repeat<ItemType>(item: ItemType, times: Int) -> ItemType[] { func repeat<ItemType>(item: ItemType, times: Int) -> [ItemType] {
var result = ItemType[]() var result = [ItemType]()
for i in 0..times { for i in 0..<times {
result += item result.append(item)
} }
return result return result
} }