mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 23:09:26 -05:00
using emplace_back instead of push_back
* using emplace_back instead of push_back is giving better results in regards of the memory management and crashes * we tried with all our best ideas, we don't know why it's better but it outperformed every other allocations method tested
This commit is contained in:
parent
6a28987a36
commit
0c75713820
@ -205,7 +205,8 @@ bool load_freqman_file(std::string& file_stem, freqman_db& db, bool load_freqs,
|
|||||||
description.shrink_to_fit();
|
description.shrink_to_fit();
|
||||||
}
|
}
|
||||||
if ((type == SINGLE && load_freqs) || (type == RANGE && load_ranges) || (type == HAMRADIO && load_hamradios)) {
|
if ((type == SINGLE && load_freqs) || (type == RANGE && load_ranges) || (type == HAMRADIO && load_hamradios)) {
|
||||||
db.push_back({frequency_a, frequency_b, description, type, modulation, bandwidth, step, tone});
|
freqman_entry entry = {frequency_a, frequency_b, std::move(description), type, modulation, bandwidth, step, tone};
|
||||||
|
db.emplace_back(entry);
|
||||||
n++;
|
n++;
|
||||||
if (n > max_num_freqs) return true;
|
if (n > max_num_freqs) return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user