We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 377c29e + daadc37 commit 67b6afbCopy full SHA for 67b6afb
docs/OptimizationTips.rst
@@ -319,7 +319,7 @@ generics. Some more examples of generics:
319
func pop() -> T { ... }
320
}
321
322
- func myAlgorithm(_ a: [T], length: Int) { ... }
+ func myAlgorithm<T>(_ a: [T], length: Int) { ... }
323
324
// The compiler can specialize code of MyStack<Int>
325
var stackOfInts: MyStack<Int>
@@ -446,7 +446,7 @@ construct such a data structure:
446
var value: T {
447
get { return ref.val }
448
set {
449
- if (!isKnownUniquelyReferenced(&ref)) {
+ if !isKnownUniquelyReferenced(&ref) {
450
ref = Ref(newValue)
451
return
452
0 commit comments