Issue #2350941 by rpayanm | dawehner: Simplify $language max weight code using max().