Speed up max_piece_type()