Use sort to compare the code list. #3623.