:nth-child and friends, use div_rem result instead of recomputing it

This commit is contained in:
Daniel Glazman 2013-11-29 12:16:53 +01:00
parent eb76ea76db
commit 6508bff1cd

View file

@ -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]