From 91c4c568d6dfa6b630e1f4e7656c5c89e7fb9061 Mon Sep 17 00:00:00 2001 From: Andi-Bogdan Postelnicu Date: Tue, 18 Apr 2023 12:42:13 +0000 Subject: [PATCH] Bug 1679492 - Remove parts that are unused from mfbt/TemplateLib. r=sergesanspaille Some implementations from TemplateLib are easily changeable with std functionality. mozilla::tl::And has been removed and replaced with std::conjuction Differential Revision: https://phabricator.services.mozilla.com/D175762 --- mfbt/TemplateLib.h | 12 ------------ mfbt/tests/TestTemplateLib.cpp | 30 ------------------------------ mfbt/tests/moz.build | 1 - testing/cppunittest.ini | 1 - 4 files changed, 44 deletions(-) delete mode 100644 mfbt/tests/TestTemplateLib.cpp diff --git a/mfbt/TemplateLib.h b/mfbt/TemplateLib.h index ff7a62e63c60..8c620390b390 100644 --- a/mfbt/TemplateLib.h +++ b/mfbt/TemplateLib.h @@ -119,18 +119,6 @@ struct MulOverflowMask<1> { static const size_t value = 0; }; -/** - * And computes the logical 'and' of its argument booleans. - * - * Examples: - * mozilla::t1::And::value is true. - * mozilla::t1::And::value is false. - * mozilla::t1::And<>::value is true. - */ - -template -struct And : std::integral_constant {}; - } // namespace tl } // namespace mozilla diff --git a/mfbt/tests/TestTemplateLib.cpp b/mfbt/tests/TestTemplateLib.cpp deleted file mode 100644 index ac8c6d268a57..000000000000 --- a/mfbt/tests/TestTemplateLib.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "mozilla/TemplateLib.h" - -using mozilla::tl::And; - -static_assert(And<>::value == true, "And<>::value should be true"); -static_assert(And::value == true, "And::value should be true"); -static_assert(And::value == false, "And::value should be false"); -static_assert(And::value == false, - "And::value should be false"); -static_assert(And::value == false, - "And::value should be false"); -static_assert(And::value == false, - "And::value should be false"); -static_assert(And::value == true, - "And::value should be true"); -static_assert(And::value == true, - "And::value should be true"); -static_assert(And::value == false, - "And::value should be false"); - -int main() { - // Nothing to do here. - return 0; -} diff --git a/mfbt/tests/moz.build b/mfbt/tests/moz.build index bc385ba25fe8..21b25b8afaed 100644 --- a/mfbt/tests/moz.build +++ b/mfbt/tests/moz.build @@ -60,7 +60,6 @@ CppUnitTests( "TestSIMD", "TestSmallPointerArray", "TestSplayTree", - "TestTemplateLib", "TestTextUtils", "TestTypedEnum", "TestUniquePtr", diff --git a/testing/cppunittest.ini b/testing/cppunittest.ini index 1b872668620b..471f6fe2e89b 100644 --- a/testing/cppunittest.ini +++ b/testing/cppunittest.ini @@ -82,7 +82,6 @@ skip-if = asan || tsan # Not built on sanitizer builds [TestSPSCQueue] [TestStackCookie] skip-if = os != 'win' -[TestTemplateLib] [TestTextUtils] [TestThreadSafeWeakPtr] [TestTypedEnum]