Skip to content

Commit 930dc18

Browse files
committed
Minor changes
1 parent 4831e74 commit 930dc18

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

octree.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,9 +1514,9 @@ namespace OrthoTree
15141514

15151515
static inline bool IsValidKey(NonLinearMortonGridID const& key) noexcept { return key.any(); }
15161516

1517-
static depth_t GetDepthID(MortonNodeID key) noexcept
1517+
static constexpr depth_t GetDepthID(MortonNodeID key) noexcept
15181518
{
1519-
// Keep shifting off three bits at a time, increasing depth counter
1519+
// Keep shifting off DIMENSION_NO bits at a time, increasing depth counter
15201520
for (depth_t d = 0; IsValidKey(key); ++d, key >>= DIMENSION_NO)
15211521
if (key == 1) // If only sentinel bit remains, exit with node depth
15221522
return d;
@@ -1640,12 +1640,12 @@ namespace OrthoTree
16401640

16411641

16421642
public: // Getters
1643-
inline auto const& GetNodes() const noexcept { return m_nodes; }
1643+
constexpr auto const& GetNodes() const noexcept { return m_nodes; }
16441644
inline bool HasNode(MortonNodeIDCR key) const noexcept { return m_nodes.contains(key); }
16451645
inline auto const& GetNode(MortonNodeIDCR key) const noexcept { return m_nodes.at(key); }
1646-
inline auto const& GetBox() const noexcept { return m_boxSpace; }
1647-
inline auto GetDepthMax() const noexcept { return m_maxDepthNo; }
1648-
inline auto GetResolutionMax() const noexcept { return m_maxRasterResolution; }
1646+
constexpr auto const& GetBox() const noexcept { return m_boxSpace; }
1647+
constexpr auto GetDepthMax() const noexcept { return m_maxDepthNo; }
1648+
constexpr auto GetResolutionMax() const noexcept { return m_maxRasterResolution; }
16491649
inline auto GetNodeIDByEntity(TEntityID entityID) const noexcept
16501650
{
16511651
autoc it = std::ranges::find_if(m_nodes, [&](autoc& keyAndValue) {
@@ -1725,7 +1725,7 @@ namespace OrthoTree
17251725
{
17261726
struct Search
17271727
{
1728-
MortonNodeID Key;
1728+
MortonNodeIDCR Key;
17291729
bool DoAvoidSelectionParent;
17301730
};
17311731

@@ -1741,7 +1741,7 @@ namespace OrthoTree
17411741
autoc doAvoidSelection = doAvoidSelectionParent || selectorUnconditional(key, node);
17421742
procedure(key, node, doAvoidSelection);
17431743

1744-
for (MortonNodeID childKey : node.GetChildren())
1744+
for (MortonNodeIDCR childKey : node.GetChildren())
17451745
nodesToProceed.push({ childKey, doAvoidSelection });
17461746
}
17471747
}
@@ -1755,7 +1755,7 @@ namespace OrthoTree
17551755
return;
17561756

17571757
procedure(key, node);
1758-
for (autoc childKey : node.GetChildren())
1758+
for (MortonNodeIDCR childKey : node.GetChildren())
17591759
VisitNodesInDFS(childKey, procedure, selector);
17601760
}
17611761

0 commit comments

Comments
 (0)