Use nitems(..) when computing max instead of the longhand version of the same logic
MFC after: 1 month