mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
Use == instead of match for tests against a single enum value
The performance of using == should now equal that of match, so many identity methods can be simplified to a single line. Fixes #1596.
This commit is contained in:
parent
6d381959db
commit
300004f3e9
75 changed files with 80 additions and 316 deletions
|
@ -69,10 +69,7 @@ pub struct Document {
|
|||
|
||||
impl DocumentDerived for EventTarget {
|
||||
fn is_document(&self) -> bool {
|
||||
match self.type_id {
|
||||
NodeTargetTypeId(DocumentNodeTypeId) => true,
|
||||
_ => false
|
||||
}
|
||||
self.type_id == NodeTargetTypeId(DocumentNodeTypeId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue