Skip to content

Commit

Permalink
Fix SelectorTmp::getAtomCount() w/ selection name (#323)
Browse files Browse the repository at this point in the history
Fixes #322
  • Loading branch information
speleo3 authored Dec 20, 2023
1 parent af77ece commit 125054d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion layer3/Selector.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class SelectorTmp {
SelectorFreeTmp(m_G, m_name);
}
const char * getName() const { return m_name; }
int getAtomCount() { return m_count; }
int getAtomCount();
SelectorID_t getIndex() const {
return m_name[0] ? SelectorIndexByName(m_G, m_name, false) : cSelectionInvalid;
}
Expand Down
9 changes: 9 additions & 0 deletions layer3/SelectorTmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ SelectorTmp::SelectorTmp(SelectorTmp&& other)
assert(other.m_count == -1);
}

int SelectorTmp::getAtomCount()
{
if (m_count != 0) {
return m_count;
}

return SelectorCountAtoms(m_G, getIndex(), cSelectorUpdateTableAllStates);
}

/**
* Factory which propagates errors.
* @param sele Selection expression
Expand Down

0 comments on commit 125054d

Please sign in to comment.