Skip to content

Commit efb76cb

Browse files
committedApr 25, 2024
Bug 1892727: Ensure KleeneValue's any_* functions are inlined. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D208513
1 parent 28aa436 commit efb76cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎servo/components/selectors/kleene_value.rs

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ impl KleeneValue {
3838

3939
/// Return true if any result of f() is true. Otherwise, return the strongest value seen.
4040
/// Returns false if empty, like that of `Iterator`.
41+
#[inline(always)]
4142
pub fn any<T>(
4243
iter: impl Iterator<Item = T>,
4344
f: impl FnMut(T) -> Self,
@@ -47,13 +48,15 @@ impl KleeneValue {
4748

4849
/// Return false if any results of f() is false. Otherwise, return the strongest value seen.
4950
/// Returns true if empty, opposite of `Iterator`.
51+
#[inline(always)]
5052
pub fn any_false<T>(
5153
iter: impl Iterator<Item = T>,
5254
f: impl FnMut(T) -> Self,
5355
) -> Self {
5456
Self::any_value(iter, Self::False, Self::True, f)
5557
}
5658

59+
#[inline(always)]
5760
fn any_value<T>(
5861
iter: impl Iterator<Item = T>,
5962
value: Self,

0 commit comments

Comments
 (0)
Failed to load comments.