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

[PVS] An unconditional 'return' within a loop. #15

Closed
tico-tico opened this issue Apr 27, 2017 · 1 comment
Closed

[PVS] An unconditional 'return' within a loop. #15

tico-tico opened this issue Apr 27, 2017 · 1 comment

Comments

@tico-tico
Copy link
Contributor

PVS-Studio found this weird loop in next.cpp

int cEngine::NextCapture(MOVES *m) {

    int move;

    while (m->next < m->last) {
        move = SelectBest(m);
        return move;
    }
    return 0;
}

I don't know if this a typo (while instead of if) or some logical error.

@tico-tico tico-tico changed the title An unconditional 'return' within a loop. [PVS] An unconditional 'return' within a loop. Sep 26, 2017
@nescitus
Copy link
Owner

Long time ago there was some filtering of bad captures done within that loop; I moved it to Quiesce() gaininig some speed, but forgot to make te loop look normal.

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

No branches or pull requests

2 participants