mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Replace uses of for foo in bar.iter()
and for foo in bar.iter_mut()
closes #7197
This commit is contained in:
parent
13e7de482c
commit
0038580abf
55 changed files with 141 additions and 154 deletions
|
@ -305,7 +305,7 @@ impl<QueueData: Sync, WorkData: Send> WorkQueue<QueueData, WorkData> {
|
|||
pub fn run(&mut self, data: &QueueData) {
|
||||
// Tell the workers to start.
|
||||
let mut work_count = AtomicUsize::new(self.work_count);
|
||||
for worker in self.workers.iter_mut() {
|
||||
for worker in &mut self.workers {
|
||||
worker.chan.send(WorkerMsg::Start(worker.deque.take().unwrap(),
|
||||
&mut work_count,
|
||||
data)).unwrap()
|
||||
|
@ -316,7 +316,7 @@ impl<QueueData: Sync, WorkData: Send> WorkQueue<QueueData, WorkData> {
|
|||
self.work_count = 0;
|
||||
|
||||
// Tell everyone to stop.
|
||||
for worker in self.workers.iter() {
|
||||
for worker in &self.workers {
|
||||
worker.chan.send(WorkerMsg::Stop).unwrap()
|
||||
}
|
||||
|
||||
|
@ -333,7 +333,7 @@ impl<QueueData: Sync, WorkData: Send> WorkQueue<QueueData, WorkData> {
|
|||
/// Synchronously measure memory usage of any thread-local storage.
|
||||
pub fn heap_size_of_tls(&self, f: fn() -> usize) -> Vec<usize> {
|
||||
// Tell the workers to measure themselves.
|
||||
for worker in self.workers.iter() {
|
||||
for worker in &self.workers {
|
||||
worker.chan.send(WorkerMsg::HeapSizeOfTLS(f)).unwrap()
|
||||
}
|
||||
|
||||
|
@ -351,7 +351,7 @@ impl<QueueData: Sync, WorkData: Send> WorkQueue<QueueData, WorkData> {
|
|||
}
|
||||
|
||||
pub fn shutdown(&mut self) {
|
||||
for worker in self.workers.iter() {
|
||||
for worker in &self.workers {
|
||||
worker.chan.send(WorkerMsg::Exit).unwrap()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue