diffcore-pickaxe: port optimization from has_changes() to diff_grep()