mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Remove unnecessary round trip conversion
This commit is contained in:
parent
08cfbc7d6c
commit
7b4e17be37
@ -99,11 +99,8 @@ bool SensorImpl::open(Sensor::Type sensor)
|
|||||||
if (!m_sensor)
|
if (!m_sensor)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Get the minimum delay allowed between events
|
|
||||||
const Time minimumDelay = microseconds(ASensor_getMinDelay(m_sensor));
|
|
||||||
|
|
||||||
// Set the event rate (not to consume too much battery)
|
// Set the event rate (not to consume too much battery)
|
||||||
ASensorEventQueue_setEventRate(sensorEventQueue, m_sensor, static_cast<std::int32_t>(minimumDelay.asMicroseconds()));
|
ASensorEventQueue_setEventRate(sensorEventQueue, m_sensor, ASensor_getMinDelay(m_sensor));
|
||||||
|
|
||||||
// Save the type of the sensor
|
// Save the type of the sensor
|
||||||
m_type = sensor;
|
m_type = sensor;
|
||||||
|
Loading…
Reference in New Issue
Block a user