From: Hun-je Yeon Date: Wed, 7 Sep 2016 14:16:58 +0000 (+0900) Subject: Change while condition in resource broker X-Git-Tag: 1.2.0+RC3~151^2^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24e1804fea87f9c64113494499c7372e6cdc5549;p=platform%2Fupstream%2Fiotivity.git Change while condition in resource broker Removing possible infinite loop with while(1) condition Change-Id: I07a85de3a38fad3265fd8712a8ce1c912fccf690 Signed-off-by: Hun-je Yeon Reviewed-on: https://gerrit.iotivity.org/gerrit/11517 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- diff --git a/service/resource-encapsulation/src/resourceBroker/src/ResourceBroker.cpp b/service/resource-encapsulation/src/resourceBroker/src/ResourceBroker.cpp index 2e3c3f9..62d9cfe 100644 --- a/service/resource-encapsulation/src/resourceBroker/src/ResourceBroker.cpp +++ b/service/resource-encapsulation/src/resourceBroker/src/ResourceBroker.cpp @@ -222,12 +222,8 @@ namespace OIC BrokerID retID = 0; srand(time(NULL)); - while(1) + while((retID==0)||( s_brokerIDMap->find(retID) != s_brokerIDMap->end())) { - if(retID != 0 && s_brokerIDMap->find(retID) == s_brokerIDMap->end()) - { - break; - } retID = (unsigned int)rand(); }