File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 20
20
21
21
EGameIDs ParseStringToGameType (const char * str);
22
22
23
- bool predicate_sort_stat (const SDrawStaticStruct* s1, const SDrawStaticStruct* s2)
24
- {
25
- return s1->IsActual () > s2->IsActual ();
26
- }
27
-
28
23
struct predicate_find_stat
29
24
{
30
25
const char * id;
@@ -58,12 +53,13 @@ CUIGameCustom::~CUIGameCustom()
58
53
void CUIGameCustom::OnFrame ()
59
54
{
60
55
CDialogHolder::OnFrame ();
61
- auto it = CustomStatics.begin ();
62
- auto it_e = CustomStatics.end ();
63
- for (; it != it_e; ++it)
64
- (*it)->Update ();
65
- // BUG: sort is never performed here, so not all inactual items will be deleted
66
- std::sort (it, it_e, predicate_sort_stat);
56
+ for (auto item : CustomStatics)
57
+ item->Update ();
58
+ auto comparer = [](const SDrawStaticStruct* s1, const SDrawStaticStruct* s2)
59
+ {
60
+ return s1->IsActual () > s2->IsActual ();
61
+ };
62
+ std::sort (CustomStatics.begin (), CustomStatics.end (), comparer);
67
63
while (!CustomStatics.empty () && !CustomStatics.back ()->IsActual ())
68
64
{
69
65
delete_data (CustomStatics.back ());
You can’t perform that action at this time.
0 commit comments