Bug 1892727: Ensure `KleeneValue`'s `any_*` functions are inlined. r=firefox-style-system-reviewers,emilio

Differential Revision: https://phabricator.services.mozilla.com/D208513
This commit is contained in:
David Shin 2024-04-25 02:23:10 +00:00
Родитель f4425129ba
Коммит eb9c75ec17
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -38,6 +38,7 @@ impl KleeneValue {
/// Return true if any result of f() is true. Otherwise, return the strongest value seen. /// Return true if any result of f() is true. Otherwise, return the strongest value seen.
/// Returns false if empty, like that of `Iterator`. /// Returns false if empty, like that of `Iterator`.
#[inline(always)]
pub fn any<T>( pub fn any<T>(
iter: impl Iterator<Item = T>, iter: impl Iterator<Item = T>,
f: impl FnMut(T) -> Self, f: impl FnMut(T) -> Self,
@ -47,6 +48,7 @@ impl KleeneValue {
/// Return false if any results of f() is false. Otherwise, return the strongest value seen. /// Return false if any results of f() is false. Otherwise, return the strongest value seen.
/// Returns true if empty, opposite of `Iterator`. /// Returns true if empty, opposite of `Iterator`.
#[inline(always)]
pub fn any_false<T>( pub fn any_false<T>(
iter: impl Iterator<Item = T>, iter: impl Iterator<Item = T>,
f: impl FnMut(T) -> Self, f: impl FnMut(T) -> Self,
@ -54,6 +56,7 @@ impl KleeneValue {
Self::any_value(iter, Self::False, Self::True, f) Self::any_value(iter, Self::False, Self::True, f)
} }
#[inline(always)]
fn any_value<T>( fn any_value<T>(
iter: impl Iterator<Item = T>, iter: impl Iterator<Item = T>,
value: Self, value: Self,