Skip to content

Commit 799a759

Browse files
author
xuchengchen
committed
If the handle does not exist, it should return false
Test: size_type erase(const key_type& key) If the key does not exist, the return value is 0 Change-Id: Idf3bf9be6d99c748b634d08fb3edc5aa02c48240 Signed-off-by: xuchengchen <xuchengchen@xiaomi.com>
1 parent 754cf33 commit 799a759

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

services/sensorservice/SensorEventConnection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ bool SensorService::SensorEventConnection::addSensor(int32_t handle) {
173173

174174
bool SensorService::SensorEventConnection::removeSensor(int32_t handle) {
175175
Mutex::Autolock _l(mConnectionLock);
176-
if (mSensorInfo.erase(handle) >= 0) {
176+
if (mSensorInfo.erase(handle) > 0) {
177177
return true;
178178
}
179179
return false;

0 commit comments

Comments
 (0)