mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Clean up Strfnd
Changes: * Fix indentation. * Pass strings by const reference. * Merge Strfnd and WStrfnd into one class instead of copying them. * Remove trailing spaces. * Fix variable names. * Move to util. * Other miscellaneous style fixes.
This commit is contained in:
parent
eb7db21d50
commit
93887043d9
14 changed files with 103 additions and 198 deletions
|
@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "filesys.h"
|
||||
#include "settings.h"
|
||||
#include "log.h"
|
||||
#include "strfnd.h"
|
||||
#include "util/strfnd.h"
|
||||
#include "defaultsettings.h" // for override_default_settings
|
||||
#include "mapgen.h" // for MapgenParams
|
||||
#include "util/string.h"
|
||||
|
@ -79,7 +79,7 @@ SubgameSpec findSubgame(const std::string &id)
|
|||
|
||||
Strfnd search_paths(getSubgamePathEnv());
|
||||
|
||||
while (!search_paths.atend()) {
|
||||
while (!search_paths.at_end()) {
|
||||
std::string path = search_paths.next(PATH_DELIM);
|
||||
find_paths.push_back(GameFindPath(
|
||||
path + DIR_DELIM + id, false));
|
||||
|
@ -153,7 +153,7 @@ std::set<std::string> getAvailableGameIds()
|
|||
|
||||
Strfnd search_paths(getSubgamePathEnv());
|
||||
|
||||
while (!search_paths.atend())
|
||||
while (!search_paths.at_end())
|
||||
gamespaths.insert(search_paths.next(PATH_DELIM));
|
||||
|
||||
for (std::set<std::string>::const_iterator i = gamespaths.begin();
|
||||
|
@ -230,7 +230,7 @@ std::vector<WorldSpec> getAvailableWorlds()
|
|||
|
||||
Strfnd search_paths(getWorldPathEnv());
|
||||
|
||||
while (!search_paths.atend())
|
||||
while (!search_paths.at_end())
|
||||
worldspaths.insert(search_paths.next(PATH_DELIM));
|
||||
|
||||
worldspaths.insert(porting::path_user + DIR_DELIM + "worlds");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue