add a couple optimazations to KeyValueScannerPriorityQueue