Avoid excessive allocation during the check face by flattening some structures and delaying the creation of the resulting queue until we know what it will be.