fix: optimization: PVS-Studio warning V832

It's better to use '= default;' syntax instead of empty constructor and destructor body.
Using '= default;' can help the compiler generate more optimal code.

Reported by: PVS-Studio

Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
Vyacheslav Ivanov 2024-08-01 23:48:24 +03:00 • committed by MihailRis
parent c858913a2f
commit aecd0f5db9
32 changed files with 38 additions and 58 deletions

View file

@ -266,7 +266,7 @@ speakerid_t audio::play(
}
auto speaker = speaker_ptr.get();
speakerid_t id = nextId++;
speakers.emplace(id, std::move(speaker_ptr));
speakers.try_emplace(id, std::move(speaker_ptr));
speaker->setPosition(position);
speaker->setVolume(volume);
speaker->setPitch(pitch);
@ -295,8 +295,8 @@ speakerid_t audio::play(
}
auto speaker = speaker_ptr.get();
speakerid_t id = nextId++;
streams.emplace(id, stream);
speakers.emplace(id, std::move(speaker_ptr));
streams.try_emplace(id, stream);
speakers.try_emplace(id, std::move(speaker_ptr));
stream->bindSpeaker(id);
speaker->setPosition(position);