diff options
author | athenian200 <athenian200@outlook.com> | 2020-09-09 01:40:15 -0500 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-09-21 10:58:32 +0000 |
commit | f43c37cabe419a38b64c68225a4256d795443aae (patch) | |
tree | f4be087c0c5e89dcf7c02805fa6fb453675b5e02 | |
parent | 157f218c8d9f026eb530bb87cb23c2b81fd42a54 (diff) | |
download | UXP-f43c37cabe419a38b64c68225a4256d795443aae.tar UXP-f43c37cabe419a38b64c68225a4256d795443aae.tar.gz UXP-f43c37cabe419a38b64c68225a4256d795443aae.tar.lz UXP-f43c37cabe419a38b64c68225a4256d795443aae.tar.xz UXP-f43c37cabe419a38b64c68225a4256d795443aae.zip |
Issue #1629 - Part 5: Remove pointless local variables.
Since the local variable is always initialized to false, we don't actually need to declare it and can just pass "false" directly as a parameter to the PrepareSheet function's bool. I was worried about code readability at first, but some well-placed comments took care of that.
-rw-r--r-- | layout/style/Loader.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index 1038ff53f..a06dd3737 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -2272,8 +2272,6 @@ Loader::LoadChildSheet(StyleSheet* aParentSheet, state = eSheetComplete; } else { bool isAlternate; - // For now, child sheets are not explicitly enabled. - bool isExplicitlyEnabled = false; const nsSubstring& empty = EmptyString(); // For now, use CORS_NONE for child sheets rv = CreateSheet(aURL, nullptr, principal, @@ -2283,8 +2281,9 @@ Loader::LoadChildSheet(StyleSheet* aParentSheet, parentData ? parentData->mSyncLoad : false, false, empty, state, &isAlternate, &sheet); NS_ENSURE_SUCCESS(rv, rv); - - PrepareSheet(sheet, empty, empty, aMedia, nullptr, isAlternate, isExplicitlyEnabled); + // For now, child sheets are not explicitly enabled (seventh argument is + // always false here). + PrepareSheet(sheet, empty, empty, aMedia, nullptr, isAlternate, false); } rv = InsertChildSheet(sheet, aParentSheet, aParentRule); @@ -2397,9 +2396,6 @@ Loader::InternalLoadNonDocumentSheet(nsIURI* aURL, StyleSheetState state; bool isAlternate; - // Sheets can only be explicitly enabled after creation and preparation, so - // set isExplicitlyEnabled to false. - bool isExplicitlyEnabled = false; RefPtr<StyleSheet> sheet; bool syncLoad = (aObserver == nullptr); const nsSubstring& empty = EmptyString(); @@ -2409,7 +2405,10 @@ Loader::InternalLoadNonDocumentSheet(nsIURI* aURL, false, empty, state, &isAlternate, &sheet); NS_ENSURE_SUCCESS(rv, rv); - PrepareSheet(sheet, empty, empty, nullptr, nullptr, isAlternate, isExplicitlyEnabled); + // Sheets can only be explicitly enabled after creation and preparation, so + // we always pass false for the initial value of the explicitly enabled flag + // when calling PrepareSheet. + PrepareSheet(sheet, empty, empty, nullptr, nullptr, isAlternate, false); if (state == eSheetComplete) { LOG((" Sheet already complete")); |