mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Polls
This commit is contained in:
@@ -181,7 +181,7 @@ public func mergeListsStableWithUpdates<T>(leftList: [T], rightList: [T], allUpd
|
||||
return (removeIndices, insertItems, updatedIndices)
|
||||
}
|
||||
|
||||
@inlinable
|
||||
//@inlinable
|
||||
public func mergeListsStableWithUpdates<T>(leftList: [T], rightList: [T], isLess: (T, T) -> Bool, isEqual: (T, T) -> Bool, getId: (T) -> AnyHashable, allUpdated: Bool = false) -> ([Int], [(Int, T, Int?)], [(Int, T, Int)]) {
|
||||
var removeIndices: [Int] = []
|
||||
var insertItems: [(Int, T, Int?)] = []
|
||||
@@ -207,6 +207,25 @@ public func mergeListsStableWithUpdates<T>(leftList: [T], rightList: [T], isLess
|
||||
}
|
||||
#endif
|
||||
|
||||
var leftStableIds: [AnyHashable] = []
|
||||
var rightStableIds: [AnyHashable] = []
|
||||
for item in leftList {
|
||||
leftStableIds.append(getId(item))
|
||||
}
|
||||
for item in rightList {
|
||||
rightStableIds.append(getId(item))
|
||||
}
|
||||
if Set(leftStableIds) == Set(rightStableIds) && leftStableIds != rightStableIds {
|
||||
/*var i = 0
|
||||
var j = 0
|
||||
while true {
|
||||
if getId(leftList[i]) != getId(rightList[i]) {
|
||||
|
||||
}
|
||||
}*/
|
||||
print("order changed")
|
||||
}
|
||||
|
||||
var currentList = leftList
|
||||
|
||||
var i = 0
|
||||
|
||||
Reference in New Issue
Block a user