1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-18 01:42:38 +01:00

Codefix: Avoiding passing new raw pointer into a smart pointer. (#13138)

Use `std::make_shared` or `std::make_unique` instead of `reset(new ...)`.
This commit is contained in:
Peter Nelson
2024-12-01 14:22:41 +00:00
committed by GitHub
parent 46176a81e3
commit e28617fda6
3 changed files with 4 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ static void OpenBankFile(const std::string &filename)
/* If there is no sound file (nosound set), don't load anything */
if (filename.empty()) return;
original_sound_file.reset(new RandomAccessFile(filename, BASESET_DIR));
original_sound_file = std::make_unique<RandomAccessFile>(filename, BASESET_DIR);
size_t pos = original_sound_file->GetPos();
uint count = original_sound_file->ReadDword();