return SuccessfulMove;
}
- auto lower = std::upper_bound(childItems.begin(), oldPos, child, compareFunction());
- auto upper = std::lower_bound(oldPos, childItems.end(), child, compareFunction());
+ const auto lower = std::upper_bound(childItems.begin(), oldPos, child, compareFunction());
+ const auto upper = std::lower_bound(oldPos, childItems.end(), child, compareFunction());
// No move needed
if (lower == upper)
return NoMove;
}
- decltype(childItems.begin()) it;
-
- // New pos in upper part
- if (lower == oldPos)
- it = upper;
- else
- it = lower;
+ const auto it = (lower == oldPos) ? upper : lower;
// Added item is not in the currently loaded data
if (it == childItems.end() && canFetchMore())