Allow most libraries to reserve capacity for their database.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -12,8 +12,11 @@ namespace CreatureLib::Library {
|
||||
std::unordered_map<std::string, GrowthRate*> _growthRates;
|
||||
|
||||
public:
|
||||
~GrowthRateLibrary(){
|
||||
for (auto gr: _growthRates){
|
||||
GrowthRateLibrary(size_t initialCapacity = 10)
|
||||
: _growthRates(std::unordered_map<std::string, GrowthRate*>(initialCapacity)) {}
|
||||
|
||||
~GrowthRateLibrary() {
|
||||
for (auto gr : _growthRates) {
|
||||
delete gr.second;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user