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

Remove top-level const from return types in "Bridge/NumPy", and other style commits #4878

Conversation

N-Dekker
Copy link
Contributor

Removing these `const` keywords enables move semantics, which may improve the
performance.

Follow-up to pull request InsightSoftwareConsortium#4872
commit 8a1498c
"STYLE: Remove `const` from `const std::string` return types"
These `obj` variables always pointed to the same object as the corresponding
`shape` parameter. Declared `shape` "const", just to be sure.
Let `_GetVnlVectorFromArray` and `_GetVnlMatrixFromArray` directly return the
constructed object. It is unnecessary to first store it in a local variable.
Directly return `PyMemoryView_FromBuffer(&pyBuffer)` instead.
@github-actions github-actions bot added the area:Bridge Issues affecting the Bridge module label Oct 10, 2024
@N-Dekker N-Dekker marked this pull request as ready for review October 10, 2024 11:59
@dzenanz dzenanz merged commit a434e3f into InsightSoftwareConsortium:master Oct 17, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Bridge Issues affecting the Bridge module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants