commit 7c847733922d6a5ddbf9df969f21374634d630c2
parent 18a690cde4eb90dcb0754f8d5fd002829e58424e
Author: serge-sans-paille <sguelton@mozilla.com>
Date: Mon, 13 Oct 2025 05:42:51 +0000
Bug 1993174 - Cleanup mfbt/Maybe.h r=emilio,win-reviewers,gstoll
- Remove unused includes
- Use some type alias
- Remove redundant inline qualifier from constexpr function
Differential Revision: https://phabricator.services.mozilla.com/D267954
Diffstat:
7 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/browser/app/winlauncher/LaunchUnelevated.h b/browser/app/winlauncher/LaunchUnelevated.h
@@ -9,7 +9,6 @@
#include "LauncherProcessWin.h"
#include "mozilla/WinHeaderOnlyUtils.h"
-#include "mozilla/Maybe.h"
#include "nsWindowsHelpers.h"
namespace mozilla {
diff --git a/browser/app/winlauncher/ProcThreadAttributes.h b/browser/app/winlauncher/ProcThreadAttributes.h
@@ -12,7 +12,6 @@
#include <utility>
#include "mozilla/Attributes.h"
-#include "mozilla/Maybe.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/Vector.h"
diff --git a/dom/base/AbstractRange.h b/dom/base/AbstractRange.h
@@ -12,7 +12,6 @@
#include "ErrorList.h"
#include "js/RootingAPI.h"
-#include "mozilla/Maybe.h"
#include "mozilla/RangeBoundary.h"
#include "mozilla/RefPtr.h"
#include "mozilla/WeakPtr.h"
diff --git a/dom/base/IdleDeadline.h b/dom/base/IdleDeadline.h
@@ -9,7 +9,6 @@
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
-#include "mozilla/Maybe.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
diff --git a/dom/base/nsTreeSanitizer.h b/dom/base/nsTreeSanitizer.h
@@ -5,7 +5,6 @@
#ifndef nsTreeSanitizer_h_
#define nsTreeSanitizer_h_
-#include "mozilla/Maybe.h"
#include "mozilla/dom/NameSpaceConstants.h"
#include "mozilla/dom/StaticAtomSet.h"
#include "nsAtom.h"
diff --git a/dom/bindings/ProxyHandlerUtils.h b/dom/bindings/ProxyHandlerUtils.h
@@ -14,7 +14,6 @@
#include "js/TypeDecls.h"
#include "jsfriendapi.h" // js::StringIsArrayIndex
#include "mozilla/Likely.h"
-#include "mozilla/Maybe.h"
#include "mozilla/TextUtils.h"
namespace mozilla::dom {
diff --git a/mfbt/Maybe.h b/mfbt/Maybe.h
@@ -34,9 +34,7 @@ namespace mozilla {
struct Nothing {};
-inline constexpr bool operator==(const Nothing&, const Nothing&) {
- return true;
-}
+constexpr bool operator==(const Nothing&, const Nothing&) { return true; }
template <class T>
class Maybe;
@@ -303,8 +301,7 @@ using IsMaybe = IsMaybeImpl<std::decay_t<T>>;
} // namespace detail
-template <typename T, typename U = typename std::remove_cv<
- typename std::remove_reference<T>::type>::type>
+template <typename T, typename U = std::remove_cv_t<std::remove_reference_t<T>>>
constexpr Maybe<U> Some(T&& aValue);
/*