diff options
| author | 2018-08-20 22:15:56 -0400 | |
|---|---|---|
| committer | 2018-08-20 22:15:56 -0400 | |
| commit | c4ce7e456a1cb86faa99f00479fe50b427a16026 (patch) | |
| tree | 49a04f9de6091b00c0c2646f759ef9b8785e6224 /src/core/telemetry_session.cpp | |
| parent | Merge pull request #1131 from bunnei/impl-tex3d-texcube (diff) | |
| parent | telemetry_session: Don't allocate std::string instances for program lifetime ... (diff) | |
| download | yuzu-c4ce7e456a1cb86faa99f00479fe50b427a16026.tar.gz yuzu-c4ce7e456a1cb86faa99f00479fe50b427a16026.tar.xz yuzu-c4ce7e456a1cb86faa99f00479fe50b427a16026.zip | |
Merge pull request #1126 from lioncash/telem
telemetry_session: Don't allocate std::string instances for program lifetime in GetTelemetryId() and RegenerateTelemetryId()
Diffstat (limited to 'src/core/telemetry_session.cpp')
| -rw-r--r-- | src/core/telemetry_session.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 7e4584fc2..69383330f 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -19,8 +19,8 @@ static u64 GenerateTelemetryId() { | |||
| 19 | 19 | ||
| 20 | u64 GetTelemetryId() { | 20 | u64 GetTelemetryId() { |
| 21 | u64 telemetry_id{}; | 21 | u64 telemetry_id{}; |
| 22 | static const std::string& filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + | 22 | const std::string filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + |
| 23 | "telemetry_id"}; | 23 | "telemetry_id"}; |
| 24 | 24 | ||
| 25 | if (FileUtil::Exists(filename)) { | 25 | if (FileUtil::Exists(filename)) { |
| 26 | FileUtil::IOFile file(filename, "rb"); | 26 | FileUtil::IOFile file(filename, "rb"); |
| @@ -44,8 +44,8 @@ u64 GetTelemetryId() { | |||
| 44 | 44 | ||
| 45 | u64 RegenerateTelemetryId() { | 45 | u64 RegenerateTelemetryId() { |
| 46 | const u64 new_telemetry_id{GenerateTelemetryId()}; | 46 | const u64 new_telemetry_id{GenerateTelemetryId()}; |
| 47 | static const std::string& filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + | 47 | const std::string filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + |
| 48 | "telemetry_id"}; | 48 | "telemetry_id"}; |
| 49 | 49 | ||
| 50 | FileUtil::IOFile file(filename, "wb"); | 50 | FileUtil::IOFile file(filename, "wb"); |
| 51 | if (!file.IsOpen()) { | 51 | if (!file.IsOpen()) { |