Replace O(n²) linear search with O(log n) binary search for checking selection overlaps when finding next selection range. Pre-sort selection ranges and use binary search to significantly improve performance when working with many selections. Release Notes: - N/A --------- Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>