src: Sort names before std::set_difference

refs: #2029

Change-Id: I170f17cd69fd5a109913c6ebe9a13ab5552132a3