17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 06:19:19 +02:00

refactor(sonar): merge collapsible nested if statements (cpp:S1066)

Comments that preceded the inner if are kept above the merged statement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 15:39:11 +02:00
parent 3198cabc78
commit f8104bd0dd
17 changed files with 616 additions and 882 deletions

View File

@@ -117,24 +117,18 @@ sound_source::deserialize( cParser &Input, sound_type const Legacytype, int cons
}
}
if( Legacyparameters & sound_parameters::range ) {
if( Input.getTokens( 1, false ) ) {
Input >> m_range;
}
if (Legacyparameters & sound_parameters::range && Input.getTokens( 1, false )) {
Input >> m_range;
}
if( Legacyparameters & sound_parameters::amplitude ) {
if( Input.getTokens( 2, false ) ) {
Input
>> m_amplitudefactor
>> m_amplitudeoffset;
}
if (Legacyparameters & sound_parameters::amplitude && Input.getTokens( 2, false )) {
Input
>> m_amplitudefactor
>> m_amplitudeoffset;
}
if( Legacyparameters & sound_parameters::frequency ) {
if( Input.getTokens( 2, false ) ) {
Input
>> m_frequencyfactor
>> m_frequencyoffset;
}
if (Legacyparameters & sound_parameters::frequency && Input.getTokens( 2, false )) {
Input
>> m_frequencyfactor
>> m_frequencyoffset;
}
}
// restore parser behaviour