Skip to content

Optim: test that could be done once has been extracted from the loop#17613

Closed
pemmanuelviel wants to merge 1 commit intoopencv:masterfrom
pemmanuelviel:pev-avoid-branching-in-loop
Closed

Optim: test that could be done once has been extracted from the loop#17613
pemmanuelviel wants to merge 1 commit intoopencv:masterfrom
pemmanuelviel:pev-avoid-branching-in-loop

Conversation

@pemmanuelviel
Copy link
Copy Markdown
Contributor

@pemmanuelviel pemmanuelviel commented Jun 22, 2020

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under OpenCV (BSD) License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@pemmanuelviel
Copy link
Copy Markdown
Contributor Author

pemmanuelviel commented Jun 22, 2020

Nowadays compiler should handle similarly both versions. However, checking quickly the assembly code obtained from an online tool between both versions, it looks like it might not be the case. So I've preferred to ensure a single evaluation of the condition whatever the compiler efficiency.
What do you think?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants