Update HashSet to LinkedHashSet to keep order

feature/top10
Aurelien Hubert 7 years ago
parent d2f68d4e12
commit c7f385d1c8
  1. 4
      app/src/main/java/net/pokeranalytics/android/model/comparison/Comparator.kt

@ -57,7 +57,7 @@ inline fun <reified T : Filterable> List<QueryCondition>.query(realm: Realm): Re
} }
fun <T> getCombinations(lists: List<List<T>>): List<List<T>> { fun <T> getCombinations(lists: List<List<T>>): List<List<T>> {
var combinations: MutableSet<List<T>> = HashSet() var combinations: MutableSet<List<T>> = LinkedHashSet()
var newCombinations: MutableSet<List<T>> var newCombinations: MutableSet<List<T>>
var index = 0 var index = 0
@ -72,7 +72,7 @@ fun <T> getCombinations(lists: List<List<T>>): List<List<T>> {
index++ index++
while (index < lists.size) { while (index < lists.size) {
val nextList = lists[index] val nextList = lists[index]
newCombinations = HashSet() newCombinations = LinkedHashSet()
for (first in combinations) { for (first in combinations) {
for (second in nextList) { for (second in nextList) {
val newList = ArrayList<T>() val newList = ArrayList<T>()

Loading…
Cancel
Save