Simplify compare length extraction with min()