Add const attribute for optimization.