Upgrade version of RxSwift, RxCocoa, Alamofire.
This commit is contained in:
@ -52,7 +52,11 @@ struct PriorityQueue<Element> {
|
||||
private mutating func removeAt(_ index: Int) {
|
||||
let removingLast = index == _elements.count - 1
|
||||
if !removingLast {
|
||||
#if swift(>=3.2)
|
||||
_elements.swapAt(index, _elements.count - 1)
|
||||
#else
|
||||
swap(&_elements[index], &_elements[_elements.count - 1])
|
||||
#endif
|
||||
}
|
||||
|
||||
_ = _elements.popLast()
|
||||
@ -72,8 +76,11 @@ struct PriorityQueue<Element> {
|
||||
while unbalancedIndex > 0 {
|
||||
let parentIndex = (unbalancedIndex - 1) / 2
|
||||
guard _hasHigherPriority(_elements[unbalancedIndex], _elements[parentIndex]) else { break }
|
||||
|
||||
#if swift(>=3.2)
|
||||
_elements.swapAt(unbalancedIndex, parentIndex)
|
||||
#else
|
||||
swap(&_elements[unbalancedIndex], &_elements[parentIndex])
|
||||
#endif
|
||||
unbalancedIndex = parentIndex
|
||||
}
|
||||
}
|
||||
@ -99,7 +106,11 @@ struct PriorityQueue<Element> {
|
||||
|
||||
guard highestPriorityIndex != unbalancedIndex else { break }
|
||||
|
||||
#if swift(>=3.2)
|
||||
_elements.swapAt(highestPriorityIndex, unbalancedIndex)
|
||||
#else
|
||||
swap(&_elements[highestPriorityIndex], &_elements[unbalancedIndex])
|
||||
#endif
|
||||
unbalancedIndex = highestPriorityIndex
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user