Skip to content

Commit 73b301d

Browse files
committed
Concurrency: Fix variable was never mutated warnings and indentation.
NFC.
1 parent 3121743 commit 73b301d

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ extension Task where Failure == Never {
766766

767767
var task: Builtin.NativeObject?
768768
#if $BuiltinCreateAsyncTaskName
769-
if var name {
769+
if let name {
770770
task =
771771
name.utf8CString.withUnsafeBufferPointer { nameBytes in
772772
Builtin.createTask(
@@ -935,27 +935,27 @@ self._task = task
935935

936936
var task: Builtin.NativeObject?
937937
#if $BuiltinCreateAsyncTaskName
938-
if var name {
939-
task =
940-
name.utf8CString.withUnsafeBufferPointer { nameBytes in
941-
Builtin.createTask(
942-
flags: flags,
943-
initialSerialExecutor: builtinSerialExecutor,
944-
taskName: nameBytes.baseAddress!._rawValue,
945-
operation: operation).0
946-
}
947-
}
938+
if let name {
939+
task =
940+
name.utf8CString.withUnsafeBufferPointer { nameBytes in
941+
Builtin.createTask(
942+
flags: flags,
943+
initialSerialExecutor: builtinSerialExecutor,
944+
taskName: nameBytes.baseAddress!._rawValue,
945+
operation: operation).0
946+
}
947+
}
948948
#endif
949-
if task == nil {
950-
// either no task name was set, or names are unsupported
951-
task = Builtin.createTask(
952-
flags: flags,
953-
initialSerialExecutor: builtinSerialExecutor,
954-
operation: operation).0
955-
}
949+
if task == nil {
950+
// either no task name was set, or names are unsupported
951+
task = Builtin.createTask(
952+
flags: flags,
953+
initialSerialExecutor: builtinSerialExecutor,
954+
operation: operation).0
955+
}
956956

957-
self._task = task!
958-
}
957+
self._task = task!
958+
}
959959
#endif
960960
}
961961

@@ -1076,7 +1076,7 @@ extension Task where Failure == Never {
10761076

10771077
var task: Builtin.NativeObject?
10781078
#if $BuiltinCreateAsyncTaskName
1079-
if var name {
1079+
if let name {
10801080
task =
10811081
name.utf8CString.withUnsafeBufferPointer { nameBytes in
10821082
Builtin.createTask(
@@ -1218,7 +1218,7 @@ extension Task where Failure == Error {
12181218

12191219
var task: Builtin.NativeObject?
12201220
#if $BuiltinCreateAsyncTaskName
1221-
if var name {
1221+
if let name {
12221222
task =
12231223
name.utf8CString.withUnsafeBufferPointer { nameBytes in
12241224
Builtin.createTask(

stdlib/public/Concurrency/TaskGroup+addTask.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ extension ${TYPE} {
243243
% # we definitely have the prior ones, as we always keep adding parameters.
244244
% if HAS_TASK_NAME:
245245
#if $BuiltinCreateAsyncTaskName
246-
if var name {
246+
if let name {
247247
task =
248248
name.utf8CString.withUnsafeBufferPointer { nameBytes in
249249
${TASK_CREATE_FN}(

0 commit comments

Comments
 (0)