mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Stop using div_rem.
This commit is contained in:
parent
138081ba25
commit
af9a8bdc73
1 changed files with 4 additions and 6 deletions
|
@ -5,7 +5,6 @@
|
|||
use std::ascii::AsciiExt;
|
||||
use std::collections::HashMap;
|
||||
use std::hash::Hash;
|
||||
use std::num::div_rem;
|
||||
use sync::Arc;
|
||||
|
||||
use url::Url;
|
||||
|
@ -1083,15 +1082,14 @@ fn matches_generic_nth_child<'a,E,N>(element: &N,
|
|||
index += 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if a == 0 {
|
||||
return b == index;
|
||||
b == index
|
||||
} else {
|
||||
(index - b) / a >= 0 &&
|
||||
(index - b) % a == 0
|
||||
}
|
||||
|
||||
let (n, r) = div_rem(index - b, a);
|
||||
n >= 0 && r == 0
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue