mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Fixed incorrect usage of const std::shared_ptr. Resolves 0003142.
Replaced const TBonusListPtr with TConstBonusListPtr where necessary Replaced const std::shared_ptr<T> with std::shared_ptr<const T> where necessary. Removed superfluous use of const. Replaced const std::shared_ptr<T> with const std::shared_ptr<T> & in function parameters and ranged for-loops.
This commit is contained in:
@@ -141,8 +141,8 @@ std::vector<si32> CStack::activeSpells() const
|
||||
return b->type != Bonus::NONE;
|
||||
}));
|
||||
|
||||
TBonusListPtr spellEffects = getBonuses(selector, Selector::all, cachingStr.str());
|
||||
for(const std::shared_ptr<Bonus> it : *spellEffects)
|
||||
TConstBonusListPtr spellEffects = getBonuses(selector, Selector::all, cachingStr.str());
|
||||
for(const auto & it : *spellEffects)
|
||||
{
|
||||
if(!vstd::contains(ret, it->sid)) //do not duplicate spells with multiple effects
|
||||
ret.push_back(it->sid);
|
||||
|
||||
Reference in New Issue
Block a user