mirror of
https://github.com/servo/servo.git
synced 2025-06-21 23:59:00 +01:00
script: Early return in CompareDocumentPosition to deindent most of the function.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
ee94e2b7c0
commit
ccd469ce61
1 changed files with 47 additions and 47 deletions
|
@ -2365,8 +2365,9 @@ impl NodeMethods for Node {
|
|||
fn CompareDocumentPosition(&self, other: &Node) -> u16 {
|
||||
if self == other {
|
||||
// step 2.
|
||||
0
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
|
||||
let mut lastself = Root::from_ref(self);
|
||||
let mut lastother = Root::from_ref(other);
|
||||
for ancestor in self.ancestors() {
|
||||
|
@ -2413,7 +2414,6 @@ impl NodeMethods for Node {
|
|||
}
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-node-contains
|
||||
fn Contains(&self, maybe_other: Option<&Node>) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue