1
This commit is contained in:
parent
0c7047a18b
commit
d1a289b78d
@ -18,6 +18,7 @@ struct AttrAddition : public std::enable_shared_from_this<AttrAddition>
|
|||||||
list_head list_entry;
|
list_head list_entry;
|
||||||
int attr_id;
|
int attr_id;
|
||||||
float value;
|
float value;
|
||||||
|
float finaly_value;
|
||||||
int source_type = kAstNone;
|
int source_type = kAstNone;
|
||||||
std::shared_ptr<AttrAddition> holder;
|
std::shared_ptr<AttrAddition> holder;
|
||||||
std::shared_ptr<std::function<std::string()>> get_source;
|
std::shared_ptr<std::function<std::string()>> get_source;
|
||||||
@ -44,6 +45,7 @@ static std::array<std::vector<std::shared_ptr<AttrAddition>>, kAstEnd> s_speed_r
|
|||||||
};
|
};
|
||||||
|
|
||||||
static float CalcSpeedRateIn(list_head* head)
|
static float CalcSpeedRateIn(list_head* head)
|
||||||
|
{
|
||||||
{
|
{
|
||||||
list_head* pos = nullptr;
|
list_head* pos = nullptr;
|
||||||
list_head* next = nullptr;
|
list_head* next = nullptr;
|
||||||
@ -66,9 +68,21 @@ static float CalcSpeedRateIn(list_head* head)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
for (auto& itr : s_speed_ratein_list) {
|
||||||
|
std::sort(itr.begin(), itr.end(),
|
||||||
|
[] (std::shared_ptr<AttrAddition> a, std::shared_ptr<AttrAddition> b) -> bool
|
||||||
|
{
|
||||||
|
return std::fabs(a->value) > std::fabs(b->value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
for (auto& itr : s_speed_ratein_list) {
|
for (auto& itr : s_speed_ratein_list) {
|
||||||
itr.clear();
|
itr.clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user