Skip to content

Try to avoid ConfigObject::GetObject(const String&typeName,const String&objName) #10274

@Al2Klimov

Description

@Al2Klimov

Is your feature request related to a problem? Please describe.

That method fetches the Type::Ptr by typeName on every call, using string lookup/comparision.

Describe the solution you'd like

If objects are fetched repeatedly for one and the same type, latter can be cached in a Type::Ptr or similar variable.

See everything of grep -rnFwe ConfigObject::GetObject lib tools which takes two non-template args.

Describe alternatives you've considered

At best, that variable is static const as in 33e609d.

Additional context

Accidental finding during #10264.

Metadata

Metadata

Assignees

No one assigned

    Labels

    core/qualityImprove code, libraries, algorithms, inline docsgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions