Skip to content

Commit

Permalink
avoid calling sort for SortedTagMap (Netflix#1463)
Browse files Browse the repository at this point in the history
When computing the id from a tag map, avoid making the
sort call when a SortedTagMap is used. That type will
already be sorted so it is not necessary.
  • Loading branch information
brharrington authored and manolama committed May 22, 2024
1 parent 12d487d commit f773243
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,17 @@ class ItemIdCalculator {
iter.nextEntry()
pos += 2
}
ArrayHelper.sortPairs(pairs, length)
case _ =>
var pos = 0
tags.foreachEntry { (k, v) =>
pairs(pos) = k
pairs(pos + 1) = v
pos += 2
}
ArrayHelper.sortPairs(pairs, length)
}

ArrayHelper.sortPairs(pairs, length)
pairs
}

Expand Down

0 comments on commit f773243

Please sign in to comment.