Skip to content

Commit 0cd4cc3

Browse files
Fix concurrency warning (#153)
Motivation: A clean build is good. Modifications: Make the warning string for debug mode a let constant. Result: No warning about concurrency safety. Co-authored-by: Peter Adams <[email protected]>
1 parent 344a517 commit 0cd4cc3

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Sources/NIOExtrasPerformanceTester/main.swift

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
// MARK: Setup
16-
var warning: String = ""
17-
assert({
18-
print("============================================================")
19-
print("= YOU ARE RUNNING NIOExtrasPerformanceTester IN DEBUG MODE =")
20-
print("============================================================")
21-
warning = " <<< DEBUG MODE >>>"
22-
return true
23-
}())
16+
let warning: String = {
17+
var warning: String = ""
18+
assert({
19+
print("============================================================")
20+
print("= YOU ARE RUNNING NIOExtrasPerformanceTester IN DEBUG MODE =")
21+
print("============================================================")
22+
warning = " <<< DEBUG MODE >>>"
23+
return true
24+
}())
25+
return warning
26+
}()
2427

2528
// MARK: Tests
2629
// Test PCAP to file.

0 commit comments

Comments
 (0)