Check condition before entering the loop
The condition doesn't change inside the loop, so there is no need to check it every iteration.
This commit is contained in:
parent
912eb37ac3
commit
f801b512c3
@ -325,12 +325,9 @@ hw_ostc3_transfer (hw_ostc3_device_t *device,
|
||||
}
|
||||
}
|
||||
|
||||
if (delay) {
|
||||
if (delay && device->available == 0) {
|
||||
unsigned int count = delay / 100;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
if (device->available)
|
||||
break;
|
||||
|
||||
size_t available = 0;
|
||||
status = dc_iostream_get_available (device->iostream, &available);
|
||||
if (status == DC_STATUS_SUCCESS && available > 0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user