diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C
index 56aaaf48385e6bd6827f9f28b7b9a22d9feaa538..10cb418a8a4e5f335ded59399667a6759a7a33ab 100644
--- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C
+++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2016 OpenFOAM Foundation
-    Copyright (C) 2016-2022 OpenCFD Ltd.
+    Copyright (C) 2016-2024 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -2661,7 +2661,7 @@ Foam::label Foam::indexedOctree<Type>::findInside(const point& sample) const
     // Need to check for the presence of content, in-case the node is empty
     if (isContent(contentIndex))
     {
-        labelList indices = contents_[getContent(contentIndex)];
+        const labelList& indices = contents_[getContent(contentIndex)];
 
         forAll(indices, elemI)
         {