Fixed collections double-sending children IOT-652
authorErich Keane <erich.keane@intel.com>
Thu, 13 Aug 2015 18:26:18 +0000 (11:26 -0700)
committerErich Keane <erich.keane@intel.com>
Fri, 14 Aug 2015 00:58:58 +0000 (00:58 +0000)
The children in a collection were being added both during
resource-conversion and during collection conversion.  This fixes this
by making sure that resources don't add their children in cases where
they are not collections.

Change-Id: I1da7f98ddcc2c0a66a30165785e46cee83b77b5d
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2200
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Omkar Hegde <omkar.m.hegde@intel.com>
resource/src/OCRepresentation.cpp

index 01969fc..f61edb3 100644 (file)
@@ -398,13 +398,6 @@ namespace OC
             }
         }
 
-        OCRepPayload* cur = root;
-        for(auto& child : this->getChildren())
-        {
-            cur->next = child.getPayload();
-            cur = cur->next;
-        }
-
         return root;
     }