In src/mongo/db/s/resharding/resharding_coordinator_commit_monitor.cpp we have code
remainingTimes.max == Milliseconds::max() ? Milliseconds(-1) : remainingTimes.max
and
remainingTimes.min == Milliseconds::max() ? Milliseconds(-1) : remainingTimes.min
Because repeating code like this is error prone (although not a bug), and to be consistent with branches 5.0 and 6.0, we should rewrite this to use a lambda
auto returnIfNotMax = [](Milliseconds t) {
return t != Milliseconds::max() ? t : Milliseconds(-1);
};