Icinga / Icinga/icinga2

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

Open
#10,274 1 comment 0 reactions 1 assignee View on GitHub

@Akulbanxal is already working on this.

Since Aug 4, 2026.

core/quality good first issue
Dominant language
C++
Stars
2.2k
Forks
616
Avg merge
5d 6h
Merged PRs (30d)
10

Description

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 33e609d7919b79fb2ae7877ab367389045b4dec9.

Additional context

Accidental finding during #10264.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.