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

Loop logic bug #844

Merged
merged 1 commit into from
Oct 21, 2023
Merged

Loop logic bug #844

merged 1 commit into from
Oct 21, 2023

Conversation

KoenDG
Copy link
Contributor

@KoenDG KoenDG commented Oct 20, 2023

Seeing the new release come out, I let the old static code analyzer run over things and went over the results, looking for anything interesting. This showed up.

The loop as it was, was never going to run. The condition is "if i is greater than mapsize", which will never be the case, since i starts at 0.

For looping over the mapsize, the condition should be reversed.

I'm unaware if there are serious implications to this never having run, nor what the implications will be now that it will, in terms of process runtime and all that.

…ince i starts at 0.

The condition should be: i smaller than mapsize, if we want to loop over the mapsize.
@haraldk
Copy link
Owner

haraldk commented Oct 21, 2023

This is really old code that I haven't looked at in years... I see IntelliJ complains as well. GitHub CodeQL does not though... 😕

I don't know the implications, as this code is obviously not covered by tests. It's probably not used much. But the fix is obviously correct, so we'll just merge it.

@haraldk haraldk merged commit d7dae90 into haraldk:master Oct 21, 2023
17 checks passed
@KoenDG KoenDG deleted the logicflow_bug branch October 21, 2023 11:27
@KoenDG
Copy link
Contributor Author

KoenDG commented Oct 21, 2023

Yeah I got it from Intellij.

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