Skip to content

llvm/lib/ObjCopy/ELF/ELFObject.h:913: Pointless copy ? #94930

Closed
@dcb314

Description

@dcb314

Static analyser cppcheck says:

llvm/lib/ObjCopy/ELF/ELFObject.h:913:33: performance: Function parameter 'Rel' should be passed by const reference. [passedByValue]

Source code is

void addRelocation(Relocation Rel) { Relocations.push_back(Rel); }

Suggest new code:

void addRelocation( const Relocation & Rel) { Relocations.push_back(Rel); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions