Update outdated pods.
This commit is contained in:
24
Pods/RxCocoa/Platform/DataStructures/Bag.swift
generated
24
Pods/RxCocoa/Platform/DataStructures/Bag.swift
generated
@ -6,7 +6,6 @@
|
||||
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Swift
|
||||
|
||||
let arrayDictionaryMaxSize = 30
|
||||
@ -44,6 +43,9 @@ struct Bag<T> : CustomDebugStringConvertible {
|
||||
var _key0: BagKey? = nil
|
||||
var _value0: T? = nil
|
||||
|
||||
// then fill "array dictionary"
|
||||
var _pairs = ContiguousArray<Entry>()
|
||||
|
||||
// last is sparse dictionary
|
||||
var _dictionary: [BagKey : T]? = nil
|
||||
|
||||
@ -77,6 +79,11 @@ struct Bag<T> : CustomDebugStringConvertible {
|
||||
return key
|
||||
}
|
||||
|
||||
if _pairs.count < arrayDictionaryMaxSize {
|
||||
_pairs.append(key: key, value: element)
|
||||
return key
|
||||
}
|
||||
|
||||
if _dictionary == nil {
|
||||
_dictionary = [:]
|
||||
}
|
||||
@ -89,7 +96,7 @@ struct Bag<T> : CustomDebugStringConvertible {
|
||||
/// - returns: Number of elements in bag.
|
||||
var count: Int {
|
||||
let dictionaryCount: Int = _dictionary?.count ?? 0
|
||||
return (_value0 != nil ? 1 : 0) + dictionaryCount
|
||||
return (_value0 != nil ? 1 : 0) + _pairs.count + dictionaryCount
|
||||
}
|
||||
|
||||
/// Removes all elements from bag and clears capacity.
|
||||
@ -97,6 +104,7 @@ struct Bag<T> : CustomDebugStringConvertible {
|
||||
_key0 = nil
|
||||
_value0 = nil
|
||||
|
||||
_pairs.removeAll(keepingCapacity: false)
|
||||
_dictionary?.removeAll(keepingCapacity: false)
|
||||
}
|
||||
|
||||
@ -118,6 +126,14 @@ struct Bag<T> : CustomDebugStringConvertible {
|
||||
return existingObject
|
||||
}
|
||||
|
||||
for i in 0 ..< _pairs.count {
|
||||
if _pairs[i].key == key {
|
||||
let value = _pairs[i].value
|
||||
_pairs.remove(at: i)
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
@ -148,6 +164,10 @@ extension Bag {
|
||||
action(value0)
|
||||
}
|
||||
|
||||
for i in 0 ..< _pairs.count {
|
||||
action(_pairs[i].value)
|
||||
}
|
||||
|
||||
if dictionary?.count ?? 0 > 0 {
|
||||
for element in dictionary!.values {
|
||||
action(element)
|
||||
|
@ -6,8 +6,6 @@
|
||||
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Sequence that repeats `repeatedValue` infinite number of times.
|
||||
struct InfiniteSequence<E> : Sequence {
|
||||
typealias Element = E
|
||||
|
@ -6,8 +6,6 @@
|
||||
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct PriorityQueue<Element> {
|
||||
private let _hasHigherPriority: (Element, Element) -> Bool
|
||||
private let _isEqual: (Element, Element) -> Bool
|
||||
|
2
Pods/RxCocoa/Platform/DataStructures/Queue.swift
generated
2
Pods/RxCocoa/Platform/DataStructures/Queue.swift
generated
@ -6,8 +6,6 @@
|
||||
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/**
|
||||
Data structure that represents queue.
|
||||
|
||||
|
Reference in New Issue
Block a user