@@ -212,15 +212,11 @@ namespace gameanalytics
212212 std::filesystem::path oldPath = dbPath;
213213 std::filesystem::path filename = oldPath.filename ();
214214
215- // get location of the faulty database
216215 oldPath = oldPath.parent_path () / " .." / filename;
217216
218- // check if no new database exists
219217 if (std::filesystem::exists (oldPath) && !std::filesystem::exists (dbPath))
220218 {
221219 std::error_code ec = {};
222-
223- // move the database to the correct location
224220 std::filesystem::rename (oldPath, dbPath, ec);
225221
226222 return ec.value () != 0 ;
@@ -233,18 +229,13 @@ namespace gameanalytics
233229 {
234230 constexpr const char * DATABASE_NAME = " ga.sqlite3" ;
235231
236- // get writable path for this platform
237232 std::filesystem::path p = device::GADevice::getWritablePath ();
238233
239- // get an unique game folder using the game key
240234 p /= state::GAState::getGameKey ();
241235
242236 dbPath = (p / DATABASE_NAME).string ();
243-
244- // check if the directory already exists
245237 if (!std::filesystem::exists (p))
246238 {
247- // check if the directory has been created
248239 if (!std::filesystem::create_directory (p))
249240 return false ;
250241
@@ -256,7 +247,6 @@ namespace gameanalytics
256247
257248 bool GAStore::ensureDatabase (bool dropDatabase, std::string const & key)
258249 {
259- // lazy creation of db path
260250 getInstance ().initDatabaseLocation ();
261251
262252 // Open database
0 commit comments