Skip to content

Change static to const since it-stability is not guaranteed#5147

Merged
mvieth merged 1 commit intoPointCloudLibrary:masterfrom
Kilidsch:master
Jan 31, 2022
Merged

Change static to const since it-stability is not guaranteed#5147
mvieth merged 1 commit intoPointCloudLibrary:masterfrom
Kilidsch:master

Conversation

@Kilidsch
Copy link
Copy Markdown
Contributor

In pcl::visualization::PCLVisualizer::resetCameraViewpoint an iterator of a std::unordered_map was saved in a static variable, even though it might get invalidated when rehashing occurs (see https://en.cppreference.com/w/cpp/container/unordered_map ).

The function also always uses the first id it was ever passed, essentially ignoring the param after the first call.

(NOTE: I am not sure, if the space between find and parantheses was intentional. If yes, I'll recreate it)

@mvieth mvieth added changelog: fix Meta-information for changelog generation module: visualization labels Jan 30, 2022
Copy link
Copy Markdown
Member

@mvieth mvieth left a comment

Choose a reason for hiding this comment

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

Thanks!
Regarding the space after find: We are slowly enforcing uniform formatting via clang-format, module-by-module. For visualization, formatting is not enforced yet, but the formatting rules say that there should not be a space between function name and parentheses. So deleting it is perfectly fine 🙂

@mvieth mvieth merged commit 49b41a6 into PointCloudLibrary:master Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: fix Meta-information for changelog generation module: visualization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants