Skip to content

Commit a8c826f

Browse files
committed
remove redundant readSample() call
Since init() now calls readSample() also for SHTSensor instances created with a fixed type, we can remove the additional check in the auto-detect loop
1 parent 6923c76 commit a8c826f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SHTSensor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ bool SHTSensor::init()
260260
i < sizeof(AUTO_DETECT_SENSORS) / sizeof(AUTO_DETECT_SENSORS[0]);
261261
++i) {
262262
mSensorType = AUTO_DETECT_SENSORS[i];
263-
if (init() && readSample()) {
263+
if (init()) {
264264
detected = true;
265265
break;
266266
}

0 commit comments

Comments
 (0)