Skip to content

Conversation

@ShenMian
Copy link
Contributor

@ShenMian ShenMian commented Apr 18, 2025

Summary

None

Purpose of change

This avoids unnecessary reference passing.
There is no need to use const std::string_view &, because std::string_view itself is a reference to a string (std::string or const char*).

Describe the solution

Although const std::string_view is closer to the original semantics, since it is a function parameter, omitting the const modifier here might be more appropriate.

Although this change might have an impact on performance, even if it does, it would be negligible.
The main purpose is to simplify the code, so I filled in "None" in the Summary section.

Describe alternatives you've considered

Testing

This change will hardly affect the behavior of the code, so no testing is necessary.

Additional context

@github-actions github-actions bot added Map / Mapgen Overmap, Mapgen, Map extras, Map display Vehicles Vehicles, parts, mechanics & interactions Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` EOC: Effects On Condition Anything concerning Effects On Condition json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Apr 18, 2025
@GuardianDll GuardianDll merged commit af3d716 into CleverRaven:master Apr 18, 2025
31 checks passed
@ShenMian ShenMian deleted the refactor-1 branch April 18, 2025 12:44
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` EOC: Effects On Condition Anything concerning Effects On Condition json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies Vehicles Vehicles, parts, mechanics & interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants