for x in xs.iter() -> for x in &xs

This commit is contained in:
Jorge Aparicio
2015-01-31 12:20:46 -05:00
parent 9f90d666e0
commit d5d7e6565a
269 changed files with 1063 additions and 1064 deletions

View File

@@ -453,7 +453,7 @@ impl CodeMap {
}
pub fn get_filemap(&self, filename: &str) -> Rc<FileMap> {
for fm in self.files.borrow().iter() {
for fm in &*self.files.borrow() {
if filename == fm.name {
return fm.clone();
}
@@ -477,7 +477,7 @@ impl CodeMap {
// The number of extra bytes due to multibyte chars in the FileMap
let mut total_extra_bytes = 0;
for mbc in map.multibyte_chars.borrow().iter() {
for mbc in &*map.multibyte_chars.borrow() {
debug!("{}-byte char at {:?}", mbc.bytes, mbc.pos);
if mbc.pos < bpos {
// every character is at least one byte, so we only