Speedup for filebrowser when opening folders with a lot of files, #3951
This commit is contained in:
parent
21d388d7ee
commit
b1dd97dac5
@ -600,13 +600,18 @@ void FileBrowser::addEntry_ (FileBrowserEntry* entry)
|
|||||||
{
|
{
|
||||||
MYWRITERLOCK(l, entryRW);
|
MYWRITERLOCK(l, entryRW);
|
||||||
|
|
||||||
std::vector<ThumbBrowserEntryBase*>::iterator i = fd.begin();
|
fd.insert(
|
||||||
|
std::lower_bound(
|
||||||
while (i != fd.end() && *entry < * ((FileBrowserEntry*)*i)) {
|
fd.begin(),
|
||||||
++i;
|
fd.end(),
|
||||||
}
|
(ThumbBrowserEntryBase*)entry,
|
||||||
|
[](ThumbBrowserEntryBase* a, ThumbBrowserEntryBase* b)
|
||||||
fd.insert (i, entry);
|
{
|
||||||
|
return *b < *a;
|
||||||
|
}
|
||||||
|
),
|
||||||
|
(ThumbBrowserEntryBase*)entry
|
||||||
|
);
|
||||||
|
|
||||||
initEntry (entry);
|
initEntry (entry);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user