aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Glazman <daniel@glazman.org>2013-11-29 12:16:53 +0100
committerDaniel Glazman <daniel@glazman.org>2013-11-29 12:16:53 +0100
commit6508bff1cd7dbf25736f34a59a6eca10a549bcd3 (patch)
tree0fa2080507f235d41fac5de9300c0843b7fbc695
parenteb76ea76db94dc360c9c2453cf80e9d6967ed41d (diff)
downloadservo-6508bff1cd7dbf25736f34a59a6eca10a549bcd3.tar.gz
servo-6508bff1cd7dbf25736f34a59a6eca10a549bcd3.zip
:nth-child and friends, use div_rem result instead of recomputing it
-rw-r--r--src/components/style/selector_matching.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/components/style/selector_matching.rs b/src/components/style/selector_matching.rs
index 36e676d007e..f36decd8fc7 100644
--- a/src/components/style/selector_matching.rs
+++ b/src/components/style/selector_matching.rs
@@ -577,7 +577,7 @@ fn matches_generic_nth_child<N: TreeNode<T>, T: TreeNodeRefAsElement<N, E>, E: E
}
let (n, r) = (index - b).div_rem(&a);
- n >= 0 && (a * n == index - b)
+ n >= 0 && r == 0
}
#[inline]