Fix copying into for-loop variables

Clang 10 got a new warning for this.

Change-Id: Ibfc911c2153dae5fa20b862b3c204b97a474d462
diff --git a/src/yang_schema.cpp b/src/yang_schema.cpp
index 5a34e4f..2719bc6 100644
--- a/src/yang_schema.cpp
+++ b/src/yang_schema.cpp
@@ -334,7 +334,7 @@
         nodes = node->child_instantiables(0);
     }
 
-    for (const auto node : nodes) {
+    for (const auto& node : nodes) {
         if (node->module()->name() == "ietf-yang-library"sv)
             continue;
         // FIXME: This is a temporary fix to filter out RPC nodes in
@@ -367,9 +367,9 @@
 
     std::vector<libyang::S_Schema_Node> nodes;
 
-    for (const auto node : yangModule->data_instantiables(0)) {
+    for (const auto& node : yangModule->data_instantiables(0)) {
         if (recursion == Recursion::Recursive) {
-            for (const auto it : node->tree_dfs()) {
+            for (const auto& it : node->tree_dfs()) {
                 res.insert(it->path(LYS_PATH_FIRST_PREFIX));
             }
         } else {