Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Al2Klimov opened this issue Dec 17, 2024 · 0 comments
Labels
core/quality Improve code, libraries, algorithms, inline docs good first issue Good for newcomers

Comments

@Al2Klimov
Copy link
Member

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.

@Al2Klimov Al2Klimov added core/quality Improve code, libraries, algorithms, inline docs good first issue Good for newcomers labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core/quality Improve code, libraries, algorithms, inline docs good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant