optimize clear_buckets max code path