kopia lustrzana https://gitlab.com/tomaszg/geostat
Fix segfault in traildb by fixing shallow copy of PowertrailDB
rodzic
add9b37d2a
commit
d33957af6c
|
@ -143,7 +143,7 @@ void PowertrailDB::save_to_json(std::string file) {
|
|||
datafile << j;
|
||||
};
|
||||
|
||||
Caches_in_Powertrails::Caches_in_Powertrails(PowertrailDB db) {
|
||||
Caches_in_Powertrails::Caches_in_Powertrails(const PowertrailDB& db) {
|
||||
for (auto& t : db.data) {
|
||||
for (auto& c : t.second.caches) {
|
||||
data.insert({ c, t.second.number });
|
||||
|
|
|
@ -53,7 +53,7 @@ class Caches_in_Powertrails {
|
|||
public:
|
||||
std::unordered_map<std::string, int> data;
|
||||
|
||||
Caches_in_Powertrails(PowertrailDB db);
|
||||
Caches_in_Powertrails(const PowertrailDB& db);
|
||||
Caches_in_Powertrails(){};
|
||||
|
||||
void read_from_json(std::string file);
|
||||
|
|
Ładowanie…
Reference in New Issue