Skip to content

Commit 7ac1643

Browse files
committed
Small perf optimization
1 parent 106b814 commit 7ac1643

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/io/IOUtil.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,12 @@ namespace kanzi
210210

211211
bool operator() (const FileData& f1, const FileData& f2) const
212212
{
213-
if (_sortBySize == false)
214-
return f1.fullPath() < f2.fullPath();
215-
216213
// First, compare parent directory paths
217214
if (f1._path != f2._path)
218215
return f1._path < f2._path;
219216

220217
// Then compare file sizes (decreasing order)
221-
return f1._size > f2._size;
218+
return _sortBySize ? f1._size > f2._size : f1._name < f2._name;
222219
}
223220
};
224221

0 commit comments

Comments
 (0)