This patch is not related to improve copy/past operation. It's only related to grid selection.
The improvement is only between when user clicks on grid select all column to until all row are selected (turned into blue). With large columns though improvement is not large but it not putting any overhead. Other hand with less columns but large row count the improvement it quite noticeable. Code change is only single line to use array concatenation instead of underscore union. I had look at union function implementation. It first flattens result set recursively and then removes duplicate which is not required in our case. All we want is indexes of complete rows in selected rows (ranges).