diff --git a/layer3/Selector.h b/layer3/Selector.h index d6d03deb5..d9c76059a 100644 --- a/layer3/Selector.h +++ b/layer3/Selector.h @@ -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; } diff --git a/layer3/SelectorTmp.cpp b/layer3/SelectorTmp.cpp index 0901680f6..6c778d6e6 100644 --- a/layer3/SelectorTmp.cpp +++ b/layer3/SelectorTmp.cpp @@ -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