Bug 1621916 - Remove unnecessary local variables; r=dom-workers-and-storage-reviewers,sg
authorJan Varga <jan.varga@gmail.com>
Wed, 27 May 2020 14:44:17 +0000
changeset 596490 24d3d987b60d0f628865afe8dc3b88ced9ea9b99
parent 596489 29086c8c3e4efab646abdc211b04b378edee0f54
child 596491 c3f73781a871c11a110eb0abf2b084569a197514
push id13186
push userffxbld-merge
push dateMon, 01 Jun 2020 09:52:46 +0000
treeherdermozilla-beta@3e7c70a1e4a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdom-workers-and-storage-reviewers, sg
bugs1621916
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1621916 - Remove unnecessary local variables; r=dom-workers-and-storage-reviewers,sg Depends on D77069 Differential Revision: https://phabricator.services.mozilla.com/D77070
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -17267,18 +17267,16 @@ nsresult QuotaClient::InitOrigin(Persist
     // delete at first instead of breaking the whole initialization.
     if (NS_WARN_IF(!databaseFilenames.GetEntry(subdirNameBase)) &&
         NS_WARN_IF((NS_FAILED(DeleteFilesNoQuota(directory, subdirName))))) {
       REPORT_TELEMETRY_INIT_ERR(kQuotaExternalError, IDB_GetEntry);
       return NS_ERROR_UNEXPECTED;
     }
   }
 
-  const auto sqliteSuffix = kSQLiteSuffix;
-
   for (const auto& databaseEntry : databaseFilenames) {
     if (aCanceled) {
       break;
     }
 
     const auto& databaseFilename = databaseEntry.GetKey();
 
     nsCOMPtr<nsIFile> fmDirectory;
@@ -17297,17 +17295,17 @@ nsresult QuotaClient::InitOrigin(Persist
 
     nsCOMPtr<nsIFile> databaseFile;
     rv = directory->Clone(getter_AddRefs(databaseFile));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       REPORT_TELEMETRY_INIT_ERR(kQuotaExternalError, IDB_Clone2);
       return rv;
     }
 
-    rv = databaseFile->Append(databaseFilename + sqliteSuffix);
+    rv = databaseFile->Append(databaseFilename + kSQLiteSuffix);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       REPORT_TELEMETRY_INIT_ERR(kQuotaExternalError, IDB_Append2);
       return rv;
     }
 
     nsCOMPtr<nsIFile> walFile;
     if (aUsageInfo) {
       rv = directory->Clone(getter_AddRefs(walFile));
@@ -17656,18 +17654,16 @@ nsresult QuotaClient::GetDatabaseFilenam
   MOZ_ASSERT(aDirectory);
 
   nsCOMPtr<nsIDirectoryEnumerator> entries;
   nsresult rv = aDirectory->GetDirectoryEntries(getter_AddRefs(entries));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  const auto sqliteSuffix = kSQLiteSuffix;
-
   nsCOMPtr<nsIFile> file;
   while (NS_SUCCEEDED((rv = entries->GetNextFile(getter_AddRefs(file)))) &&
          file && !aCanceled) {
     nsString leafName;
     rv = file->GetLeafName(leafName);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
@@ -17712,17 +17708,17 @@ nsresult QuotaClient::GetDatabaseFilenam
 
     // The SQLite WAL file does count towards quota, but it is handled below
     // once we find the actual database file.
     if (StringEndsWith(leafName, kSQLiteWALSuffix)) {
       continue;
     }
 
     nsDependentSubstring leafNameBase;
-    if (!GetFilenameBase(leafName, sqliteSuffix, leafNameBase)) {
+    if (!GetFilenameBase(leafName, kSQLiteSuffix, leafNameBase)) {
       nsString path;
       MOZ_ALWAYS_SUCCEEDS(file->GetPath(path));
       MOZ_ASSERT(!path.IsEmpty());
 
       const nsPrintfCString warning(
           R"(An unexpected file exists in the storage )"
           R"(area: "%s")",
           NS_ConvertUTF16toUTF8(path).get());