mirror of https://github.com/encounter/objdiff.git
Simplify common_symbols by using iterators (#28)
This commit is contained in:
parent
019493f944
commit
cd46be7726
|
@ -126,13 +126,10 @@ fn symbols_by_section(obj_file: &File<'_>, section: &ObjSection) -> Result<Vec<O
|
||||||
}
|
}
|
||||||
|
|
||||||
fn common_symbols(obj_file: &File<'_>) -> Result<Vec<ObjSymbol>> {
|
fn common_symbols(obj_file: &File<'_>) -> Result<Vec<ObjSymbol>> {
|
||||||
let mut result = Vec::<ObjSymbol>::new();
|
obj_file.symbols()
|
||||||
for symbol in obj_file.symbols() {
|
.filter(Symbol::is_common)
|
||||||
if symbol.is_common() {
|
.map(|symbol| to_obj_symbol(obj_file, &symbol, 0))
|
||||||
result.push(to_obj_symbol(obj_file, &symbol, 0)?);
|
.collect::<Result<Vec<ObjSymbol>>>()
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(result)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn find_section_symbol(
|
fn find_section_symbol(
|
||||||
|
|
Loading…
Reference in New Issue