RangeUpper: use std::upper_bound rather than find_if, re #8085

upper_bound will be faster if any, and find_if is deprecated