Commit ce6abb81 authored by Jun Cai's avatar Jun Cai Committed by Commit Bot

Generic sensor code clean up (add necessary and remove unnecessary {})

This CL adds necessary {} and removes unnecessary {} for generic_sensor
code.

Bug: None
Change-Id: I1a752303d39ddb2d215a018ee6adeacd7f8d1b58
Reviewed-on: https://chromium-review.googlesource.com/687556Reviewed-by: default avatarMikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
Commit-Queue: Jun Cai <juncai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504757}
parent 37ec1859
......@@ -103,8 +103,9 @@ void SensorDeviceManager::OnDeviceAdded(udev_device* dev) {
}
if (sensor_file_names.empty() ||
sensor_file_names.size() > SensorReadingRaw::kValuesCount)
sensor_file_names.size() > SensorReadingRaw::kValuesCount) {
continue;
}
const std::string scaling_value =
GetUdevDeviceGetSysattrValue(dev, data.sensor_scale_name.c_str());
......
......@@ -138,9 +138,8 @@ bool PlatformSensor::UpdateSensorInternal(const ConfigMap& configurations) {
const auto& conf_list = pair.second;
for (const auto& configuration : conf_list) {
if (!optimal_configuration || configuration > *optimal_configuration) {
if (!optimal_configuration || configuration > *optimal_configuration)
optimal_configuration = &configuration;
}
}
}
......
......@@ -23,8 +23,9 @@ bool PlatformSensorFusionAlgorithm::IsReadingSignificantlyDifferent(
const SensorReading& reading2) {
for (size_t i = 0; i < SensorReadingRaw::kValuesCount; ++i) {
if (std::fabs(reading1.raw.values[i] - reading2.raw.values[i]) >=
threshold_)
threshold_) {
return true;
}
}
return false;
}
......
......@@ -238,8 +238,9 @@ void PlatformSensorProviderLinux::OnDeviceRemoved(
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
auto it = sensor_devices_by_type_.find(type);
if (it != sensor_devices_by_type_.end() &&
it->second->device_node == device_node)
it->second->device_node == device_node) {
sensor_devices_by_type_.erase(it);
}
}
void PlatformSensorProviderLinux::CreateFusionSensor(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment