зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
f4425129ba
Коммит
eb9c75ec17
|
@ -38,6 +38,7 @@ impl KleeneValue {
|
|||
|
||||
/// Return true if any result of f() is true. Otherwise, return the strongest value seen.
|
||||
/// Returns false if empty, like that of `Iterator`.
|
||||
#[inline(always)]
|
||||
pub fn any<T>(
|
||||
iter: impl Iterator<Item = T>,
|
||||
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.
|
||||
/// Returns true if empty, opposite of `Iterator`.
|
||||
#[inline(always)]
|
||||
pub fn any_false<T>(
|
||||
iter: impl Iterator<Item = T>,
|
||||
f: impl FnMut(T) -> Self,
|
||||
|
@ -54,6 +56,7 @@ impl KleeneValue {
|
|||
Self::any_value(iter, Self::False, Self::True, f)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn any_value<T>(
|
||||
iter: impl Iterator<Item = T>,
|
||||
value: Self,
|
||||
|
|
Загрузка…
Ссылка в новой задаче