mirror of
https://github.com/serge1/ELFIO.git
synced 2025-03-19 19:21:03 +00:00
Reduce complexity of 'if' nesting
This commit is contained in:
parent
f1c7d420e4
commit
cfa213d646
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -97,5 +97,6 @@
|
||||
]
|
||||
},
|
||||
"gtest-adapter.debugConfig": "Run ELFIO Tests",
|
||||
"gtest-adapter.supportLocation": true
|
||||
"gtest-adapter.supportLocation": true,
|
||||
"sonarlint.pathToCompileCommands": "${workspaceFolder}/build/compile_commands.json"
|
||||
}
|
@ -300,18 +300,17 @@ class elfio
|
||||
for ( int j = i+1; j < sections.size(); ++j ) {
|
||||
const section* a = sections[i];
|
||||
const section* b = sections[j];
|
||||
if ( ((a->get_type() & SHT_NOBITS) == 0)
|
||||
&& ((b->get_type() & SHT_NOBITS) == 0)
|
||||
&& (a->get_size() > 0)
|
||||
&& (b->get_size() > 0)
|
||||
&& (a->get_offset() > 0)
|
||||
&& (b->get_offset() > 0)) {
|
||||
if ( is_offset_in_section( a->get_offset(), b )
|
||||
|| is_offset_in_section( a->get_offset()+a->get_size()-1, b )
|
||||
|| is_offset_in_section( b->get_offset(), a )
|
||||
|| is_offset_in_section( b->get_offset()+b->get_size()-1, a )) {
|
||||
if ( ( ( a->get_type() & SHT_NOBITS) == 0 )
|
||||
&& ( ( b->get_type() & SHT_NOBITS) == 0 )
|
||||
&& ( a->get_size() > 0 )
|
||||
&& ( b->get_size() > 0 )
|
||||
&& ( a->get_offset() > 0 )
|
||||
&& ( b->get_offset() > 0 )
|
||||
&& ( is_offset_in_section( a->get_offset(), b )
|
||||
|| is_offset_in_section( a->get_offset()+a->get_size()-1, b )
|
||||
|| is_offset_in_section( b->get_offset(), a )
|
||||
|| is_offset_in_section( b->get_offset()+b->get_size()-1, a ) ) ) {
|
||||
errors += "Sections " + a->get_name() + " and " + b->get_name() + " overlap in file\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user