mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
profile: Simplify profiler's find or insert code.
This commit is contained in:
parent
cc262c641f
commit
ed87fcf6cf
1 changed files with 1 additions and 6 deletions
|
@ -296,12 +296,7 @@ impl Profiler {
|
|||
}
|
||||
|
||||
fn find_or_insert(&mut self, k: (ProfilerCategory, Option<TimerMetadata>), t: f64) {
|
||||
match self.buckets.get_mut(&k) {
|
||||
None => {},
|
||||
Some(v) => { v.push(t); return; },
|
||||
}
|
||||
|
||||
self.buckets.insert(k, vec!(t));
|
||||
self.buckets.entry(k).or_insert_with(Vec::new).push(t);
|
||||
}
|
||||
|
||||
fn handle_msg(&mut self, msg: ProfilerMsg) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue