Skip to content

Commit d4a1261

Browse files
committed
---
yaml --- r: 346084 b: refs/heads/master c: 24755cc h: refs/heads/master
1 parent 469917f commit d4a1261

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5f7255f193310bf6e1668dc291cfedd3f5930891
2+
refs/heads/master: 24755cceade872e7a36addd3b459c141d1571ddd
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/stdlib/private/SwiftPrivateThreadExtras/SwiftPrivateThreadExtras.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ public func _stdlib_thread_join<Result>(
120120
let result = WaitForSingleObject(thread, 0xffffffff);
121121
// TODO(compnerd) modularize WinBase.h for WAIT_OBJECT_0 (0)
122122
if result == 0 {
123-
let threadResult: DWORD = 0
123+
var threadResult: DWORD = 0
124124
GetExitCodeThread(thread, &threadResult)
125125
CloseHandle(thread)
126126

127-
return (result,
127+
return (CInt(result),
128128
UnsafeMutablePointer<DWORD>(&threadResult)
129129
.withMemoryRebound(to: Result.self, capacity: 1){ $0.pointee })
130130
} else {
131-
return (result, nil)
131+
return (CInt(result), nil)
132132
}
133133
#else
134134
var threadResultRawPtr: UnsafeMutableRawPointer?

trunk/stdlib/public/core/DictionaryCasting.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
public func _dictionaryUpCast<DerivedKey, DerivedValue, BaseKey, BaseValue>(
2222
_ source: Dictionary<DerivedKey, DerivedValue>
2323
) -> Dictionary<BaseKey, BaseValue> {
24-
var result = Dictionary<BaseKey, BaseValue>(minimumCapacity: source.count)
24+
var builder = _DictionaryBuilder<BaseKey, BaseValue>(count: source.count)
2525

2626
for (k, v) in source {
27-
result[k as! BaseKey] = (v as! BaseValue)
27+
builder.add(key:k as! BaseKey, value: v as! BaseValue)
2828
}
29-
return result
29+
return builder.take()
3030
}
3131

3232
/// Called by the casting machinery.
@@ -98,11 +98,11 @@ public func _dictionaryDownCastConditional<
9898
_ source: Dictionary<BaseKey, BaseValue>
9999
) -> Dictionary<DerivedKey, DerivedValue>? {
100100

101-
var result = Dictionary<DerivedKey, DerivedValue>()
101+
var builder = _DictionaryBuilder<DerivedKey, DerivedValue>(count: source.count)
102102
for (k, v) in source {
103103
guard let k1 = k as? DerivedKey, let v1 = v as? DerivedValue
104104
else { return nil }
105-
result[k1] = v1
105+
builder.add(key: k1, value: v1)
106106
}
107-
return result
107+
return builder.take()
108108
}

0 commit comments

Comments
 (0)