Variable declaration incorporated in for() loop itself.
authorJaehong Jo <jaehong.jo@samsung.com>
Thu, 27 Aug 2015 11:45:33 +0000 (20:45 +0900)
committerJon A. Cruz <jonc@osg.samsung.com>
Thu, 27 Aug 2015 19:02:52 +0000 (19:02 +0000)
https://gerrit.iotivity.org/gerrit/#/c/2277/

Change-Id: I83c03bdba83109b9a313dee977efd13b6e65aa55
Signed-off-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2303
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c

index 413a4ef..d5fee43 100644 (file)
@@ -166,14 +166,9 @@ static void CAReceiveHandler(void *data)
         // if new socket object is added in socket list after below logic is ran.
         // new socket will be started to read after next while loop
         uint32_t length = CAEDRGetSocketListLength();
-        if (0 == length)
+        if (0 != length)
         {
-            OIC_LOG(DEBUG, TAG, "socket list is empty");
-        }
-        else
-        {
-            uint32_t idx;
-            for (idx = 0; idx < length; idx++)
+            for (uint32_t idx = 0; idx < length; idx++)
             {
                 OIC_LOG(DEBUG, TAG, "start CAEDRNativeReadData");
                 CAEDRNativeReadData(env, idx, ctx->type);