If the user only selects one file, this dataset will be compared with itself. However, it is still checked twice, and stored in memory twice. I realize that the entire algorithm has to be rewritten to use a single copy in memory, but the second file check is completely redundant and takes unnecessary time. All second-dataset variables (number of spectra etc.) can be assigned the values from the first check for this special case.
The double memory allocation is less of an issue, as if there is not enough memory to compare two files, all other functions of compareMS2 are out of the question as well.
If the user only selects one file, this dataset will be compared with itself. However, it is still checked twice, and stored in memory twice. I realize that the entire algorithm has to be rewritten to use a single copy in memory, but the second file check is completely redundant and takes unnecessary time. All second-dataset variables (number of spectra etc.) can be assigned the values from the first check for this special case.
The double memory allocation is less of an issue, as if there is not enough memory to compare two files, all other functions of compareMS2 are out of the question as well.