fix findleaves mindepth handling regression

commit 07afecf4c2c8b23f425ac0085a5fbed9e7e49e4e fixed, but
next commit 997e4ccc92e3134c56d9d640d9dc9fba4b60d346 reverted.

apply the same change as commit 07afecf4c2c8b23f425ac0085a5fbed9e7e49e4e
1 file changed