Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2f38aca authored by Michael Wright's avatar Michael Wright
Browse files

Fix for-loop type.

Technically the iterator provides a std::pair<const KEY, VALUE>&, so
we're constructing a std::pair<KEY, VALUE> from it and then taking a
const reference to that. This creates an unnecessary copy but then
obscures that by taking a reference to it; we should either take a
reference to the iterator's actual type or use the value type of the
temporary we construct directly.

Bug: N/A
Test: compile
Change-Id: I0ed11c1a80a5ac419f74f100573d4a2f042141fd
parent 88ce0fa5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ JoystickInputMapper::Axis JoystickInputMapper::createAxis(const AxisInfo& axisIn
}

bool JoystickInputMapper::haveAxis(int32_t axisId) {
    for (const std::pair<int32_t, Axis>& pair : mAxes) {
    for (const std::pair<const int32_t, Axis>& pair : mAxes) {
        const Axis& axis = pair.second;
        if (axis.axisInfo.axis == axisId ||
            (axis.axisInfo.mode == AxisInfo::MODE_SPLIT && axis.axisInfo.highAxis == axisId)) {