* There was a bug in the way the mimetypes list was constructed, it would recalculate the list on

each addition, which is o(n). It's already refreshed lazily on read, only rarely when ContainerWindow updates 
his menu.
 Now there's only one recalc when finished adding poses, 9ms for 20K files here.
Pose adding is almost linear now for the first thousand files, but it gets worse after that due to 
another known problem. Now doing 35s instead of 80s on a 20K files folder here, more to come :) 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28891 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner
2009-01-12 19:42:41 +00:00
parent 077a475a14
commit e5a30119a0
-4
View File
@@ -1626,7 +1626,6 @@ BPoseView::CreatePoses(Model **models, PoseInfo *poseInfoArray, int32 count,
if (resultingPoses)
resultingPoses[modelIndex] = pose;
AddMimeType(model->MimeType());
// set location from poseinfo if saved loc was for this dir
if (poseInfo->fInitedDirectory != -1LL) {
PinPointToValidRange(poseInfo->fLocation);
@@ -1800,9 +1799,6 @@ BPoseView::CountMimeTypes()
void
BPoseView::AddMimeType(const char *mimeType)
{
if (fMimeTypeListIsDirty)
RefreshMimeTypeList();
int32 count = fMimeTypeList->CountItems();
for (int32 index = 0; index < count; index++) {
if (*fMimeTypeList->ItemAt(index) == mimeType)