diff --git a/poincare/include/poincare/tree_pool.h b/poincare/include/poincare/tree_pool.h index 2974c8fe9..752fbf0ad 100644 --- a/poincare/include/poincare/tree_pool.h +++ b/poincare/include/poincare/tree_pool.h @@ -24,7 +24,15 @@ public: static TreePool * sharedPool(); // Node - TreeNode * node(int identifier) const; + TreeNode * node(int identifier) const { + if (identifier <= TreeNode::FirstStaticNodeIdentifier) { + int index = indexOfStaticNode(identifier); + assert(index >= 0 && index < MaxNumberOfStaticNodes); + return m_staticNodes[index]; + } + assert(identifier >= 0 && identifier <= MaxNumberOfNodes); + return m_nodeForIdentifier[identifier]; + } TreeNode * last() const { return reinterpret_cast(const_cast(m_cursor)); } template diff --git a/poincare/src/tree_pool.cpp b/poincare/src/tree_pool.cpp index 916bd5abc..4c331c3a8 100644 --- a/poincare/src/tree_pool.cpp +++ b/poincare/src/tree_pool.cpp @@ -10,16 +10,6 @@ TreePool * TreePool::sharedPool() { return &pool; } -TreeNode * TreePool::node(int identifier) const { - if (identifier <= FirstStaticNodeIdentifier) { - int index = indexOfStaticNode(identifier); - assert(index >= 0 && index < MaxNumberOfStaticNodes); - return m_staticNodes[index]; - } - assert(identifier >= 0 && identifier <= MaxNumberOfNodes); - return m_nodeForIdentifier[identifier]; -} - static void memmove32(uint32_t * dst, uint32_t * src, size_t len) { if (src < dst && dst < src + len) { /* Copy backwards to avoid overwrites */