Skip to content

Commit d711b4b

Browse files
committed
Optimize CDetailManager performance
1 parent 5ae2527 commit d711b4b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Layers/xrRender/DetailManager.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,9 @@ void CDetailManager::UpdateVisibleM()
266266
#endif
267267
float R = D.bv_sphere.R;
268268
float Rq_drcp = R*R*dist_sq_rcp; // reordered expression for 'ssa' calc
269-
270-
for (auto& SItem : sp.items)
269+
auto& ditems = D.m_items;
270+
auto& items = sp.items;
271+
for (auto& SItem : items)
271272
{
272273
CDetail::SlotItem& Item = *SItem;
273274
float scale = Item.scale_calculated = Item.scale*alpha_i;
@@ -279,7 +280,7 @@ void CDetailManager::UpdateVisibleM()
279280
u32 vis_id = 0;
280281
if (ssa > r_ssaCHEAP)
281282
vis_id = Item.vis_ID;
282-
D.m_items[vis_id][calc_key].push_back(SItem);
283+
ditems[vis_id][calc_key].push_back(SItem);
283284
}
284285
}
285286
}

0 commit comments

Comments
 (0)