mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-26 06:26:17 -05:00
Reserve length of AIS packet text std::string.
This commit is contained in:
parent
3644bfd983
commit
2a2e65abad
@ -247,6 +247,8 @@ std::string Packet::text(
|
||||
const size_t character_count
|
||||
) const {
|
||||
std::string result;
|
||||
result.reserve(character_count);
|
||||
|
||||
const size_t character_length = 6;
|
||||
const size_t end_bit = start_bit + character_count * character_length;
|
||||
for(size_t i=start_bit; i<end_bit; i+=character_length) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user