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

Tidy analyseNode #1295

Merged
merged 12 commits into from
Nov 11, 2024
Merged

Tidy analyseNode #1295

merged 12 commits into from
Nov 11, 2024

Conversation

hsorby
Copy link
Contributor

@hsorby hsorby commented Nov 8, 2024

Fixes #1293.

@hsorby hsorby added the Modified feature Existing feature modified from current behaviour label Nov 8, 2024
@hsorby hsorby requested review from agarny and nickerso November 8, 2024 23:21
Makes the code easier to read/maintain for me... who tends to work on the analyser. :)
Copy link
Contributor

@agarny agarny left a comment

Choose a reason for hiding this comment

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

I honestly can't see how this is tidying up the code. There are now more if statements and we even call swapLeftAndRightChildren() (7.23k times in our tests, i.e. ~94% of the time!). IOW, the code is now less efficient and, for me, more difficult to understand.

Otherwise, if you are to "tidy" that bit of code then you might also want to "tidy" the case of a piecewise statement (search for childCount >= 2).

Bottom line, if you guys are happy with this PR then feel free to force merge it.

@hsorby hsorby merged commit 4357d2b into cellml:main Nov 11, 2024
14 checks passed
@hsorby hsorby deleted the analyse-node-tidy branch November 11, 2024 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Modified feature Existing feature modified from current behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tidy code in Analyser::AnalyserImpl::analyseNode
3 participants