зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1665890 - Use QM_TRY_RETURN where possible; r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D90679
This commit is contained in:
Родитель
63434c4e40
Коммит
45dd2a39a3
|
@ -697,8 +697,7 @@ mozilla::Result<mozilla::Ok, nsresult> CollectWhileHasResult(
|
|||
mozIStorageStatement& aStmt, StepFunc&& aStepFunc) {
|
||||
return CollectWhile(
|
||||
[&aStmt]() -> Result<bool, nsresult> {
|
||||
IDB_TRY_VAR(auto hasResult, MOZ_TO_RESULT_INVOKE(aStmt, ExecuteStep));
|
||||
return hasResult;
|
||||
IDB_TRY_RETURN(MOZ_TO_RESULT_INVOKE(aStmt, ExecuteStep));
|
||||
},
|
||||
[&aStmt, &aStepFunc] { return aStepFunc(aStmt); });
|
||||
}
|
||||
|
@ -12835,11 +12834,8 @@ nsresult FileManager::InitDirectory(nsIFile& aDirectory, nsIFile& aDatabaseFile,
|
|||
|
||||
IDB_TRY(CollectEach(
|
||||
[&entries]() -> Result<nsCOMPtr<nsIFile>, nsresult> {
|
||||
IDB_TRY_VAR(
|
||||
auto file,
|
||||
ToResultInvoke<nsCOMPtr<nsIFile>>(
|
||||
std::mem_fn(&nsIDirectoryEnumerator::GetNextFile), entries));
|
||||
return file;
|
||||
IDB_TRY_RETURN(ToResultInvoke<nsCOMPtr<nsIFile>>(
|
||||
std::mem_fn(&nsIDirectoryEnumerator::GetNextFile), entries));
|
||||
},
|
||||
[&hasJournals](
|
||||
const nsCOMPtr<nsIFile>& file) -> Result<mozilla::Ok, nsresult> {
|
||||
|
@ -12950,11 +12946,8 @@ Result<FileUsageType, nsresult> FileManager::GetUsage(nsIFile* aDirectory) {
|
|||
|
||||
IDB_TRY(CollectEach(
|
||||
[&entries]() -> Result<nsCOMPtr<nsIFile>, nsresult> {
|
||||
IDB_TRY_VAR(
|
||||
auto file,
|
||||
ToResultInvoke<nsCOMPtr<nsIFile>>(
|
||||
std::mem_fn(&nsIDirectoryEnumerator::GetNextFile), entries));
|
||||
return file;
|
||||
IDB_TRY_RETURN(ToResultInvoke<nsCOMPtr<nsIFile>>(
|
||||
std::mem_fn(&nsIDirectoryEnumerator::GetNextFile), entries));
|
||||
},
|
||||
[&usage](const nsCOMPtr<nsIFile>& file) -> Result<mozilla::Ok, nsresult> {
|
||||
IDB_TRY_VAR(
|
||||
|
|
|
@ -659,11 +659,8 @@ Result<mozilla::Ok, nsresult> CollectEachFileEntry(
|
|||
|
||||
return CollectEach(
|
||||
[&entries]() -> Result<nsCOMPtr<nsIFile>, nsresult> {
|
||||
QM_TRY_VAR(const auto file,
|
||||
MOZ_TO_RESULT_INVOKE_TYPED(nsCOMPtr<nsIFile>, entries,
|
||||
GetNextFile));
|
||||
|
||||
return file;
|
||||
QM_TRY_RETURN(MOZ_TO_RESULT_INVOKE_TYPED(nsCOMPtr<nsIFile>, entries,
|
||||
GetNextFile));
|
||||
},
|
||||
[&aFileFunc, &aDirectoryFunc](
|
||||
const nsCOMPtr<nsIFile>& file) -> Result<mozilla::Ok, nsresult> {
|
||||
|
|
Загрузка…
Ссылка в новой задаче