Don't clear selection if the text didn't change.
Don't do the work to clear if the set is empty.
Merge branch 'origin/master'
Don't do the work to clear if the map is empty.
Merge branch 'origin/master'