Remove unneed linking in update_loop_data (#85)

Commit a5862a0 made the linking step in update_loop_data unecessary
because the loop's copy of the data was made to come from the parent
loop's data rather than the original client's data.

While at it, also add one more nested loop test case.
diff --git a/include/inja/renderer.hpp b/include/inja/renderer.hpp
index f87a6b7..124507e 100644
--- a/include/inja/renderer.hpp
+++ b/include/inja/renderer.hpp
@@ -106,21 +106,9 @@
     }
   }
 
-  void update_loop_data(bool link = true)  {
+  void update_loop_data()  {
     LoopLevel& level = m_loop_stack.back();
 
-    if (link && (m_loop_stack.size() > 1)) {
-      for (int i = m_loop_stack.size() - 2; i >= 0; i--) {
-        auto& level_it = m_loop_stack.at(i);
-
-        if (level_it.loop_type == LoopLevel::Type::Array) {
-          level.data[static_cast<std::string>(level_it.value_name)] = level_it.values.at(level_it.index);
-        } else {
-          level.data[static_cast<std::string>(level_it.value_name)] = *level_it.map_it->second;
-        }
-      }
-    }
-
     if (level.loop_type == LoopLevel::Type::Array) {
       level.data[static_cast<std::string>(level.value_name)] = level.values.at(level.index); // *level.it;
       auto& loopData = level.data["loop"];
@@ -551,7 +539,7 @@
             break;
           }
 
-          update_loop_data(false);
+          update_loop_data();
 
           // jump back to start of loop
           i = bc.args - 1;  // -1 due to ++i in loop
diff --git a/single_include/inja/inja.hpp b/single_include/inja/inja.hpp
index 0fa6b41..918f0a1 100644
--- a/single_include/inja/inja.hpp
+++ b/single_include/inja/inja.hpp
@@ -2710,21 +2710,9 @@
     }
   }
 
-  void update_loop_data(bool link = true)  {
+  void update_loop_data()  {
     LoopLevel& level = m_loop_stack.back();
 
-    if (link && (m_loop_stack.size() > 1)) {
-      for (int i = m_loop_stack.size() - 2; i >= 0; i--) {
-        auto& level_it = m_loop_stack.at(i);
-
-        if (level_it.loop_type == LoopLevel::Type::Array) {
-          level.data[static_cast<std::string>(level_it.value_name)] = level_it.values.at(level_it.index);
-        } else {
-          level.data[static_cast<std::string>(level_it.value_name)] = *level_it.map_it->second;
-        }
-      }
-    }
-
     if (level.loop_type == LoopLevel::Type::Array) {
       level.data[static_cast<std::string>(level.value_name)] = level.values.at(level.index); // *level.it;
       auto& loopData = level.data["loop"];
@@ -3155,7 +3143,7 @@
             break;
           }
 
-          update_loop_data(false);
+          update_loop_data();
 
           // jump back to start of loop
           i = bc.args - 1;  // -1 due to ++i in loop
diff --git a/test/unit-renderer.cpp b/test/unit-renderer.cpp
index dfc6e71..b352765 100644
--- a/test/unit-renderer.cpp
+++ b/test/unit-renderer.cpp
@@ -70,6 +70,34 @@
 		// CHECK_THROWS_WITH( env.render("{% for name in relatives %}{{ name }}{% endfor %}", data), "[inja.exception.json_error] [json.exception.type_error.302] type must be array, but is object" );
 	}
 
+	SECTION("nested loops") {
+		auto ldata = json::parse(
+R"DELIM(
+{ "outer" : [ 
+	{ "inner" : [
+		{ "in2" : [ 1, 2 ] },
+		{ "in2" : []},
+		{ "in2" : []}
+		]
+	},
+	{ "inner" : [] },
+	{ "inner" : [
+		{ "in2" : [ 3, 4 ] },
+		{ "in2" : [ 5, 6 ] }
+		]
+	}
+	]
+}
+)DELIM"
+				);
+		CHECK(env.render(R"DELIM(
+{% for o in outer %}{% for i in o.inner %}{{loop.parent.index}}:{{loop.index}}::{{loop.parent.is_last}}
+{% for ii in i.in2%}{{ii}},{%endfor%}
+{%endfor%}{%endfor%}
+)DELIM",
+					ldata) == "\n0:0::false\n1,2,\n0:1::false\n\n0:2::false\n\n2:0::true\n3,4,\n2:1::true\n5,6,\n\n");
+	}
+
 	SECTION("conditionals") {
 		CHECK( env.render("{% if is_happy %}Yeah!{% endif %}", data) == "Yeah!" );
 		CHECK( env.render("{% if is_sad %}Yeah!{% endif %}", data) == "" );