1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 01:12:39 +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

@@ -370,7 +370,7 @@ bool GraphicsSet::FillSetDetails(const IniFile &ini, const std::string &path, co
GRFConfig &GraphicsSet::GetOrCreateExtraConfig() const
{
if (!this->extra_cfg) {
this->extra_cfg.reset(new GRFConfig(this->files[GFT_EXTRA].filename));
this->extra_cfg = std::make_unique<GRFConfig>(this->files[GFT_EXTRA].filename);
/* We know the palette of the base set, so if the base NewGRF is not
* setting one, use the palette of the base set and not the global