Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
6aa1b0eb
Commit
6aa1b0eb
authored
4 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Faster lookup in large inventories via hashmaps
parent
8777548b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/newview/llinventorymodel.h
+7
-4
7 additions, 4 deletions
indra/newview/llinventorymodel.h
indra/newview/llinventorypanel.cpp
+1
-2
1 addition, 2 deletions
indra/newview/llinventorypanel.cpp
indra/newview/llinventorypanel.h
+3
-1
3 additions, 1 deletion
indra/newview/llinventorypanel.h
with
11 additions
and
7 deletions
indra/newview/llinventorymodel.h
+
7
−
4
View file @
6aa1b0eb
...
@@ -48,6 +48,9 @@
...
@@ -48,6 +48,9 @@
#include
"lleventcoro.h"
#include
"lleventcoro.h"
#include
"llcoros.h"
#include
"llcoros.h"
#include
"absl/container/node_hash_map.h"
#include
"absl/container/flat_hash_map.h"
class
LLInventoryObserver
;
class
LLInventoryObserver
;
class
LLInventoryObject
;
class
LLInventoryObject
;
class
LLInventoryItem
;
class
LLInventoryItem
;
...
@@ -175,13 +178,13 @@ class LLInventoryModel
...
@@ -175,13 +178,13 @@ class LLInventoryModel
// the inventory using several different identifiers.
// the inventory using several different identifiers.
// mInventory member data is the 'master' list of inventory, and
// mInventory member data is the 'master' list of inventory, and
// mCategoryMap and mItemMap store uuid->object mappings.
// mCategoryMap and mItemMap store uuid->object mappings.
typedef
std
::
map
<
LLUUID
,
LLPointer
<
LLViewerInventoryCategory
>
>
cat_map_t
;
typedef
absl
::
flat_hash_
map
<
LLUUID
,
LLPointer
<
LLViewerInventoryCategory
>
>
cat_map_t
;
typedef
std
::
map
<
LLUUID
,
LLPointer
<
LLViewerInventoryItem
>
>
item_map_t
;
typedef
absl
::
flat_hash_
map
<
LLUUID
,
LLPointer
<
LLViewerInventoryItem
>
>
item_map_t
;
cat_map_t
mCategoryMap
;
cat_map_t
mCategoryMap
;
item_map_t
mItemMap
;
item_map_t
mItemMap
;
// This last set of indices is used to map parents to children.
// This last set of indices is used to map parents to children.
typedef
std
::
map
<
LLUUID
,
cat_array_t
*>
parent_cat_map_t
;
typedef
absl
::
flat_hash_
map
<
LLUUID
,
cat_array_t
*>
parent_cat_map_t
;
typedef
std
::
map
<
LLUUID
,
item_array_t
*>
parent_item_map_t
;
typedef
absl
::
flat_hash_
map
<
LLUUID
,
item_array_t
*>
parent_item_map_t
;
parent_cat_map_t
mParentChildCategoryTree
;
parent_cat_map_t
mParentChildCategoryTree
;
parent_item_map_t
mParentChildItemTree
;
parent_item_map_t
mParentChildItemTree
;
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llinventorypanel.cpp
+
1
−
2
View file @
6aa1b0eb
...
@@ -1722,8 +1722,7 @@ LLFolderViewItem* LLInventoryPanel::getItemByID(const LLUUID& id)
...
@@ -1722,8 +1722,7 @@ LLFolderViewItem* LLInventoryPanel::getItemByID(const LLUUID& id)
{
{
LL_RECORD_BLOCK_TIME
(
FTM_GET_ITEM_BY_ID
);
LL_RECORD_BLOCK_TIME
(
FTM_GET_ITEM_BY_ID
);
std
::
map
<
LLUUID
,
LLFolderViewItem
*>::
iterator
map_it
;
auto
map_it
=
mItemMap
.
find
(
id
);
map_it
=
mItemMap
.
find
(
id
);
if
(
map_it
!=
mItemMap
.
end
())
if
(
map_it
!=
mItemMap
.
end
())
{
{
return
map_it
->
second
;
return
map_it
->
second
;
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llinventorypanel.h
+
3
−
1
View file @
6aa1b0eb
...
@@ -39,6 +39,8 @@
...
@@ -39,6 +39,8 @@
#include
"lluictrlfactory.h"
#include
"lluictrlfactory.h"
#include
<set>
#include
<set>
#include
"absl/container/flat_hash_map.h"
class
LLInvFVBridge
;
class
LLInvFVBridge
;
class
LLInventoryFolderViewModelBuilder
;
class
LLInventoryFolderViewModelBuilder
;
class
LLInvPanelComplObserver
;
class
LLInvPanelComplObserver
;
...
@@ -280,7 +282,7 @@ class LLInventoryPanel : public LLPanel
...
@@ -280,7 +282,7 @@ class LLInventoryPanel : public LLPanel
LLPointer
<
LLFolderViewGroupedItemBridge
>
mGroupedItemBridge
;
LLPointer
<
LLFolderViewGroupedItemBridge
>
mGroupedItemBridge
;
Params
mParams
;
// stored copy of parameter block
Params
mParams
;
// stored copy of parameter block
std
::
map
<
LLUUID
,
LLFolderViewItem
*>
mItemMap
;
absl
::
flat_hash_
map
<
LLUUID
,
LLFolderViewItem
*>
mItemMap
;
/**
/**
* Pointer to LLInventoryFolderViewModelBuilder.
* Pointer to LLInventoryFolderViewModelBuilder.
*
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment