mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix unnecessary
unsafe block
warning
This commit is contained in:
parent
6364636693
commit
fc49e10f7e
1 changed files with 4 additions and 6 deletions
|
@ -168,12 +168,10 @@ impl<T: Send> BufferPool<T> {
|
|||
}
|
||||
|
||||
fn free(&self, buf: Box<Buffer<T>>) {
|
||||
unsafe {
|
||||
let mut pool = self.pool.lock();
|
||||
match pool.iter().position(|v| v.size() > buf.size()) {
|
||||
Some(i) => pool.insert(i, buf),
|
||||
None => pool.push(buf),
|
||||
}
|
||||
let mut pool = self.pool.lock();
|
||||
match pool.iter().position(|v| v.size() > buf.size()) {
|
||||
Some(i) => pool.insert(i, buf),
|
||||
None => pool.push(buf),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue