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

Fix lookup in SPTree #2759

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/nrncvode/sptree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,14 +584,9 @@
*/
template <typename SPBLK>
SPBLK* splookup(double key, SPTREE<SPBLK>* q) {
SPBLK* n;
int Sct;
nrnhines marked this conversation as resolved.
Show resolved Hide resolved

/* find node in the tree */
n = q->root;
// while( n && (Sct = STRCMP( key, n->key ) ) )
while (n && (Sct = key != n->key)) {
n = (Sct < 0) ? n->leftlink : n->rightlink;
SPBLK* n = q->root;
while (n && key != n->key) {
n = key < n->key ? n->leftlink : n->rightlink;

Check warning on line 589 in src/nrncvode/sptree.hpp

View check run for this annotation

Codecov / codecov/patch

src/nrncvode/sptree.hpp#L587-L589

Added lines #L587 - L589 were not covered by tests
}

/* reorganize tree around this node */
Expand Down
Loading