(#2543) - avoid excessive sort() in merge.js