From 396131897458e64b14550c8d9955f580c038d595 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 11 Oct 2023 12:31:12 +0100 Subject: [PATCH] Codechange: Accept std::string in RemoveGroup(). --- src/ini_load.cpp | 4 ++-- src/ini_type.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ini_load.cpp b/src/ini_load.cpp index 69c29bc4ba..30344a144a 100644 --- a/src/ini_load.cpp +++ b/src/ini_load.cpp @@ -189,9 +189,9 @@ IniGroup *IniLoadFile::GetGroup(const std::string &name, bool create_new) * Remove the group with the given name. * @param name name of the group to remove. */ -void IniLoadFile::RemoveGroup(const char *name) +void IniLoadFile::RemoveGroup(const std::string &name) { - size_t len = strlen(name); + size_t len = name.length(); IniGroup *prev = nullptr; IniGroup *group; diff --git a/src/ini_type.h b/src/ini_type.h index 192ac8598e..e82aba24f2 100644 --- a/src/ini_type.h +++ b/src/ini_type.h @@ -62,7 +62,7 @@ struct IniLoadFile { virtual ~IniLoadFile(); IniGroup *GetGroup(const std::string &name, bool create_new = true); - void RemoveGroup(const char *name); + void RemoveGroup(const std::string &name); void LoadFromDisk(const std::string &filename, Subdirectory subdir);