Skip to content

Commit 67b6afb

Browse files
authored
Merge pull request swiftlang#28976 from kastiglione/patch-1
Minor syntax updates to OptimizationTips
2 parents 377c29e + daadc37 commit 67b6afb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/OptimizationTips.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ generics. Some more examples of generics:
319319
func pop() -> T { ... }
320320
}
321321

322-
func myAlgorithm(_ a: [T], length: Int) { ... }
322+
func myAlgorithm<T>(_ a: [T], length: Int) { ... }
323323

324324
// The compiler can specialize code of MyStack<Int>
325325
var stackOfInts: MyStack<Int>
@@ -446,7 +446,7 @@ construct such a data structure:
446446
var value: T {
447447
get { return ref.val }
448448
set {
449-
if (!isKnownUniquelyReferenced(&ref)) {
449+
if !isKnownUniquelyReferenced(&ref) {
450450
ref = Ref(newValue)
451451
return
452452
}

0 commit comments

Comments
 (0)