mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 03:59:19 +02:00
refactor(sonar): scope single-use variables in if init-statements (cpp:S6004)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,8 +86,7 @@ void ui::vehicles_bank::parse_category_entry(const std::string ¶m)
|
||||
if (tok.size() < 1)
|
||||
return;
|
||||
|
||||
auto it = type_map.find(tok[0]);
|
||||
if (it != type_map.end())
|
||||
if (auto it = type_map.find(tok[0]); it != type_map.end())
|
||||
ctx_type = it->second;
|
||||
else if (tok[0] >= 'A' && tok[0] <= 'Z')
|
||||
ctx_type = vehicle_type::carriage;
|
||||
|
||||
Reference in New Issue
Block a user