forked from qt-creator/qt-creator
FileUtils: Replace FileNameList with an alias
The functionality in that class is covered by initializers and Utils::unique, so there is no need to keep a custom class. This way FileNameList plays way nicer with utils/algorithm.h. Change-Id: I8eeae6aca0558ecd998920c4fdfc5ea56bf75501 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -763,25 +763,6 @@ QTextStream &operator<<(QTextStream &s, const FileName &fn)
|
||||
return s << fn.toString();
|
||||
}
|
||||
|
||||
int FileNameList::removeDuplicates()
|
||||
{
|
||||
QSet<FileName> seen;
|
||||
int removed = 0;
|
||||
|
||||
for (int i = 0; i < size(); ) {
|
||||
const FileName &fn = at(i);
|
||||
if (seen.contains(fn)) {
|
||||
removeAt(i);
|
||||
++removed;
|
||||
} else {
|
||||
seen.insert(fn);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
return removed;
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
Reference in New Issue
Block a user