Skip to content

Release 8.2: Fix alias lookup bug by replacing InterViews String with std::string.#3687

Open
nrnhines wants to merge 2 commits intorelease/8.2from
hines/alias-fix
Open

Release 8.2: Fix alias lookup bug by replacing InterViews String with std::string.#3687
nrnhines wants to merge 2 commits intorelease/8.2from
hines/alias-fix

Conversation

@nrnhines
Copy link
Copy Markdown
Member

@nrnhines nrnhines commented Dec 24, 2025

When the key to an std::map is an InterViews String, the lookup could match to a non-identical String.
This is fixed by using an std::map with an std::string key

Closes #3688

@sonarqubecloud
Copy link
Copy Markdown

@nrnhines nrnhines changed the title Fix alias lookup bug by replacing InterViews String with std::string. Release 8.2: Fix alias lookup bug by replacing InterViews String with std::string. Jan 19, 2026
Comment thread src/ivoc/strfun.cpp
Comment on lines -373 to 375
String s(name);
std::string s(name);
const auto& it = symtab_.find(s);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can avoid copy by using std::string_view here.

const auto& it = symtab_.find(std::string_view(name));

This is true for all the subsequent ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants