Skip to content

Commit a01599c

Browse files
committed
Refactor
1 parent 87e4c7f commit a01599c

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

src/input-sections.cc

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,12 @@ void InputSection<E>::write_to(Context<E> &ctx, u8 *buf) {
279279
template <typename E>
280280
std::string_view
281281
InputSection<E>::get_func_name(Context<E> &ctx, i64 offset) const {
282-
for (Symbol<E> *sym : file.symbols) {
283-
if (sym->file == &file) {
284-
const ElfSym<E> &esym = sym->esym();
285-
if (esym.st_shndx == shndx && esym.st_type == STT_FUNC &&
286-
esym.st_value <= offset && offset < esym.st_value + esym.st_size) {
287-
if (ctx.arg.demangle)
288-
return demangle(*sym);
289-
return sym->name();
290-
}
291-
}
292-
}
282+
for (Symbol<E> *sym : file.symbols)
283+
if (sym->file == &file)
284+
if (const ElfSym<E> &esym = sym->esym();
285+
esym.st_shndx == shndx && esym.st_type == STT_FUNC &&
286+
esym.st_value <= offset && offset < esym.st_value + esym.st_size)
287+
return ctx.arg.demangle ? demangle(*sym) : sym->name();
293288
return "";
294289
}
295290

0 commit comments

Comments
 (0)