Skip to content

Commit 0e8a37b

Browse files
Properly fix potentially inconsiderate naming
1 parent 821a5a6 commit 0e8a37b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

validation-test/stdlib/StringSlicesConcurrentAppend.swift

+12-12
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ extension String {
2525
// different non-shared strings that point to the same shared buffer.
2626

2727
enum ThreadID {
28-
case Leader
29-
case Follower
28+
case Primary
29+
case Replica
3030
}
3131

3232
var barrierVar: UnsafeMutablePointer<_stdlib_pthread_barrier_t> = nil
3333
var sharedString: String = ""
34-
var followerString: String = ""
34+
var replicaString: String = ""
3535

3636
func barrier() {
3737
var ret = _stdlib_pthread_barrier_wait(barrierVar)
@@ -41,7 +41,7 @@ func barrier() {
4141
func sliceConcurrentAppendThread(tid: ThreadID) {
4242
for i in 0..<100 {
4343
barrier()
44-
if tid == .Leader {
44+
if tid == .Primary {
4545
// Get a fresh buffer.
4646
sharedString = ""
4747
sharedString.appendContentsOf("abc")
@@ -57,7 +57,7 @@ func sliceConcurrentAppendThread(tid: ThreadID) {
5757
barrier()
5858

5959
// Append to the private string.
60-
if tid == .Leader {
60+
if tid == .Primary {
6161
privateString.appendContentsOf("def")
6262
} else {
6363
privateString.appendContentsOf("ghi")
@@ -66,22 +66,22 @@ func sliceConcurrentAppendThread(tid: ThreadID) {
6666
barrier()
6767

6868
// Verify that contents look good.
69-
if tid == .Leader {
69+
if tid == .Primary {
7070
expectEqual("abcdef", privateString)
7171
} else {
7272
expectEqual("abcghi", privateString)
7373
}
7474
expectEqual("abc", sharedString)
7575

7676
// Verify that only one thread took ownership of the buffer.
77-
if tid == .Follower {
78-
followerString = privateString
77+
if tid == .Replica {
78+
replicaString = privateString
7979
}
8080
barrier()
81-
if tid == .Leader {
81+
if tid == .Primary {
8282
expectTrue(
8383
(privateString.bufferID == sharedString.bufferID) !=
84-
(followerString.bufferID == sharedString.bufferID))
84+
(replicaString.bufferID == sharedString.bufferID))
8585
}
8686
}
8787
}
@@ -93,9 +93,9 @@ StringTestSuite.test("SliceConcurrentAppend") {
9393
expectEqual(0, ret)
9494

9595
let (createRet1, tid1) = _stdlib_pthread_create_block(
96-
nil, sliceConcurrentAppendThread, .Leader)
96+
nil, sliceConcurrentAppendThread, .Primary)
9797
let (createRet2, tid2) = _stdlib_pthread_create_block(
98-
nil, sliceConcurrentAppendThread, .Follower)
98+
nil, sliceConcurrentAppendThread, .Replica)
9999

100100
expectEqual(0, createRet1)
101101
expectEqual(0, createRet2)

0 commit comments

Comments
 (0)