summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/StatSerializer.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-08-21 19:15:34 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-21 19:15:34 +0200
commit8620f6a13ef6db5c13989a4f1ec4d4304c8128c6 (patch)
tree0ea42a1592188d216ca0643bb9fb1b48bc1f98c1 /src/WorldStorage/StatSerializer.cpp
parentMake StatSerializer a namespace (diff)
downloadcuberite-8620f6a13ef6db5c13989a4f1ec4d4304c8128c6.tar
cuberite-8620f6a13ef6db5c13989a4f1ec4d4304c8128c6.tar.gz
cuberite-8620f6a13ef6db5c13989a4f1ec4d4304c8128c6.tar.bz2
cuberite-8620f6a13ef6db5c13989a4f1ec4d4304c8128c6.tar.lz
cuberite-8620f6a13ef6db5c13989a4f1ec4d4304c8128c6.tar.xz
cuberite-8620f6a13ef6db5c13989a4f1ec4d4304c8128c6.tar.zst
cuberite-8620f6a13ef6db5c13989a4f1ec4d4304c8128c6.zip
Diffstat (limited to '')
-rw-r--r--src/WorldStorage/StatSerializer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/WorldStorage/StatSerializer.cpp b/src/WorldStorage/StatSerializer.cpp
index eff80149e..66be4fc7f 100644
--- a/src/WorldStorage/StatSerializer.cpp
+++ b/src/WorldStorage/StatSerializer.cpp
@@ -106,7 +106,7 @@ static const std::unordered_map<std::string_view, Statistic> LegacyMapping
namespace StatSerializer
{
- auto MakeStatisticsDirectory(const std::string & WorldPath, std::string FileName)
+ auto MakeStatisticsDirectory(const std::string & WorldPath, std::string && FileName)
{
// Even though stats are shared between worlds, they are (usually) saved
// inside the folder of the default world.
@@ -196,10 +196,10 @@ namespace StatSerializer
- void Load(cStatManager & Manager, const std::string & WorldPath, std::string FileName)
+ void Load(cStatManager & Manager, const std::string & WorldPath, std::string && FileName)
{
Json::Value Root;
- InputFileStream(MakeStatisticsDirectory(WorldPath, FileName)) >> Root;
+ InputFileStream(MakeStatisticsDirectory(WorldPath, std::move(FileName))) >> Root;
LoadLegacyFromJSON(Manager, Root);
LoadCustomStatFromJSON(Manager, Root["stats"]["custom"]);
@@ -209,13 +209,13 @@ namespace StatSerializer
- void Save(const cStatManager & Manager, const std::string & WorldPath, std::string FileName)
+ void Save(const cStatManager & Manager, const std::string & WorldPath, std::string && FileName)
{
Json::Value Root;
SaveStatToJSON(Manager, Root["stats"]);
Root["DataVersion"] = NamespaceSerializer::DataVersion();
- OutputFileStream(MakeStatisticsDirectory(WorldPath, FileName)) << Root;
+ OutputFileStream(MakeStatisticsDirectory(WorldPath, std::move(FileName))) << Root;
}
}