Cleanup: Pass optional constant string reference by value

Small constant trivial referencing objects should be passed by value.
Current state of code most likely legacy from the times there was an optional strings.

Pull Request: https://projects.blender.org/blender/blender/pulls/138058
This commit is contained in:
илья _
2025-06-16 20:34:32 +02:00
committed by Hans Goudey
parent 407dcb39d4
commit 4b88e3dbdd
6 changed files with 8 additions and 14 deletions

View File

@@ -13,11 +13,8 @@ struct Mesh;
namespace blender::geometry {
Mesh *create_cuboid_mesh(const float3 &size,
int verts_x,
int verts_y,
int verts_z,
const std::optional<StringRef> &uv_id);
Mesh *create_cuboid_mesh(
const float3 &size, int verts_x, int verts_y, int verts_z, std::optional<StringRef> uv_id);
Mesh *create_cuboid_mesh(const float3 &size, int verts_x, int verts_y, int verts_z);

View File

@@ -12,10 +12,7 @@ struct Mesh;
namespace blender::geometry {
Mesh *create_grid_mesh(int verts_x,
int verts_y,
float size_x,
float size_y,
const std::optional<StringRef> &uv_map_id);
Mesh *create_grid_mesh(
int verts_x, int verts_y, float size_x, float size_y, std::optional<StringRef> uv_map_id);
} // namespace blender::geometry

View File

@@ -26,6 +26,6 @@ Bounds<float3> calculate_bounds_radial_primitive(float radius_top,
Mesh *create_uv_sphere_mesh(float radius,
int segments,
int rings,
const std::optional<StringRef> &uv_map_id);
std::optional<StringRef> uv_map_id);
} // namespace blender::geometry

View File

@@ -369,7 +369,7 @@ Mesh *create_cuboid_mesh(const float3 &size,
const int verts_x,
const int verts_y,
const int verts_z,
const std::optional<StringRef> &uv_id)
const std::optional<StringRef> uv_id)
{
const CuboidConfig config(size, verts_x, verts_y, verts_z);

View File

@@ -41,7 +41,7 @@ Mesh *create_grid_mesh(const int verts_x,
const int verts_y,
const float size_x,
const float size_y,
const std::optional<StringRef> &uv_map_id)
const std::optional<StringRef> uv_map_id)
{
BLI_assert(verts_x > 0 && verts_y > 0);
const int edges_x = verts_x - 1;

View File

@@ -298,7 +298,7 @@ static Bounds<float3> calculate_bounds_uv_sphere(const float radius,
Mesh *create_uv_sphere_mesh(const float radius,
const int segments,
const int rings,
const std::optional<StringRef> &uv_map_id)
const std::optional<StringRef> uv_map_id)
{
Mesh *mesh = BKE_mesh_new_nomain(sphere_vert_total(segments, rings),
sphere_edge_total(segments, rings),