From: kibak.yoon Date: Mon, 18 Jul 2016 11:19:11 +0000 (+0900) Subject: sensord: return false if the size of id is 0 X-Git-Tag: accepted/tizen/3.0/ivi/20161011.062327^2~2^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fsystem%2Fsensord.git;a=commitdiff_plain;h=91c8bc6f668275ff47e9d183955ba2eb8177c4ef sensord: return false if the size of id is 0 - If the size of ids is zero, it doesn't need to process the next works. - It doesn't make a problem although it is not fixed. but it would be better to reduce the unnecessary work. Change-Id: I2187d738ee90bae47cb4276b39b5651afa771b97 Signed-off-by: kibak.yoon --- diff --git a/src/server/physical_sensor.cpp b/src/server/physical_sensor.cpp index fc16b7b..65ab74e 100644 --- a/src/server/physical_sensor.cpp +++ b/src/server/physical_sensor.cpp @@ -94,6 +94,9 @@ bool physical_sensor::read_fd(std::vector &ids) size = m_sensor_device->read_fd(&_ids); + if (size == 0) + return false; + for (int i = 0; i < size; ++i) ids.push_back(_ids[i]);