Skip to content

Commit

Permalink
Fix lookup in SPTree
Browse files Browse the repository at this point in the history
  • Loading branch information
alkino committed Feb 22, 2024
1 parent 8dcb742 commit fc044b9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/nrncvode/sptree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,17 +911,15 @@ SPBLK* spenqafter(SPBLK* n, SPBLK* n1, SPTREE<SPBLK>* q) {
template <typename SPBLK>
SPBLK* splookup(double key, SPTREE<SPBLK>* q) {
SPBLK* n;
int Sct;
int c;

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

Expand Down

0 comments on commit fc044b9

Please sign in to comment.