1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-25 23:49:09 +00:00

Codechange: use std::string_view for NewsTypeData

This commit is contained in:
Rubidium
2025-04-26 11:42:28 +02:00
committed by rubidium42
parent 42f0aa24f6
commit e1db09a41f

View File

@@ -106,7 +106,7 @@ enum class NewsDisplay : uint8_t {
* Per-NewsType data
*/
struct NewsTypeData {
const char * const name; ///< Name
const std::string_view name; ///< Name
const uint8_t age; ///< Maximum age of news items (in days)
const SoundFx sound; ///< Sound
@@ -116,7 +116,7 @@ struct NewsTypeData {
* @param age The maximum age for these messages.
* @param sound The sound to play.
*/
NewsTypeData(const char *name, uint8_t age, SoundFx sound) :
NewsTypeData(std::string_view name, uint8_t age, SoundFx sound) :
name(name),
age(age),
sound(sound)