Skip to content

Commit f26c2f1

Browse files
committed
0: Fixes for Island: Anonymous delegates are now unique.
1 parent 8ffadf8 commit f26c2f1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Source/Array.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,9 @@ public struct Array<T>
652652
//}
653653

654654
public func map<U>(_ transform: (T) -> U) -> ISequence<U> { // we deliberatey return a sequence, not an array, for efficiency and flexibility.
655-
#if JAVA
655+
#if JAVA || ISLAND
656656
return list.Select({ return transform($0) })
657-
#elseif CLR || ISLAND || COCOA
657+
#elseif CLR || COCOA
658658
return list.Select(transform)
659659
#endif
660660
}
@@ -664,9 +664,9 @@ public struct Array<T>
664664
//}
665665

666666
public func filter(_ includeElement: (T) -> Bool) -> ISequence<T> { // we deliberatey return a sequence, not an array, for efficiency and flexibility.
667-
#if JAVA
667+
#if JAVA || ISLAND
668668
return list.Where({ return includeElement($0) })
669-
#elseif CLR || ISLAND || COCOA
669+
#elseif CLR || COCOA
670670
return list.Where(includeElement)
671671
#endif
672672
}

Source/Dispatch.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,31 +157,31 @@ public class DispatchQueue : DispatchObject {
157157
}
158158

159159
public func asyncAfter(deadline: DispatchTime, execute work: () -> ()) {
160-
dispatch_after(deadline.rawValue, self.queue, work)
160+
dispatch_after(deadline.rawValue, self.queue, { work(); })
161161
}
162162

163163
public func asyncAfter(wallDeadline: DispatchWallTime, execute work: () -> ()) {
164-
dispatch_after(wallDeadline.rawValue, self.queue, work)
164+
dispatch_after(wallDeadline.rawValue, self.queue, { work(); })
165165
}
166166

167167
public func concurrentPerform(iterations: Int, execute work: (UInt) -> ()) {
168-
dispatch_apply(iterations, self.queue, work)
168+
dispatch_apply(iterations, self.queue, { work($0) })
169169
}
170170

171171
public func async(execute work: () -> ()) {
172-
dispatch_async(self.queue, work)
172+
dispatch_async(self.queue, { work(); })
173173
}
174174

175175
public func async(group: DispatchGroup?, execute work: () -> ()) {
176176
if group != nil {
177-
dispatch_group_async(group!.group, self.queue, work)
177+
dispatch_group_async(group!.group, self.queue, { work() })
178178
} else {
179-
dispatch_async(self.queue, work)
179+
dispatch_async(self.queue, { work() })
180180
}
181181
}
182182

183183
public func sync(execute work: () -> ()) {
184-
dispatch_sync(self.queue, work)
184+
dispatch_sync(self.queue, { work() })
185185
}
186186

187187
#if !ISLAND

0 commit comments

Comments
 (0)