##// END OF EJS Templates
rust-dirstate: remove unneeded "ref"...
Yuya Nishihara -
r43062:cc424cc1 default
parent child Browse files
Show More
@@ -92,7 +92,7 b' pub fn pack_dirstate('
92 .iter()
92 .iter()
93 .map(|(filename, _)| {
93 .map(|(filename, _)| {
94 let mut length = MIN_ENTRY_SIZE + filename.len();
94 let mut length = MIN_ENTRY_SIZE + filename.len();
95 if let Some(ref copy) = copy_map.get(filename) {
95 if let Some(copy) = copy_map.get(filename) {
96 length += copy.len() + 1;
96 length += copy.len() + 1;
97 }
97 }
98 length
98 length
@@ -106,8 +106,8 b' pub fn pack_dirstate('
106 packed.extend(&parents.p1);
106 packed.extend(&parents.p1);
107 packed.extend(&parents.p2);
107 packed.extend(&parents.p2);
108
108
109 for (ref filename, entry) in state_map.iter() {
109 for (filename, entry) in state_map.iter() {
110 let mut new_filename: Vec<u8> = filename.to_vec();
110 let mut new_filename: Vec<u8> = filename.to_owned();
111 let mut new_mtime: i32 = entry.mtime;
111 let mut new_mtime: i32 = entry.mtime;
112 if entry.state == EntryState::Normal && entry.mtime == now {
112 if entry.state == EntryState::Normal && entry.mtime == now {
113 // The file was last modified "simultaneously" with the current
113 // The file was last modified "simultaneously" with the current
@@ -121,7 +121,7 b' pub fn pack_dirstate('
121 // mistakenly treating such files as clean.
121 // mistakenly treating such files as clean.
122 new_mtime = -1;
122 new_mtime = -1;
123 new_state_map.push((
123 new_state_map.push((
124 filename.to_owned().to_vec(),
124 filename.to_owned(),
125 DirstateEntry {
125 DirstateEntry {
126 mtime: new_mtime,
126 mtime: new_mtime,
127 ..*entry
127 ..*entry
@@ -129,7 +129,7 b' pub fn pack_dirstate('
129 ));
129 ));
130 }
130 }
131
131
132 if let Some(copy) = copy_map.get(*filename) {
132 if let Some(copy) = copy_map.get(filename) {
133 new_filename.push('\0' as u8);
133 new_filename.push('\0' as u8);
134 new_filename.extend(copy);
134 new_filename.extend(copy);
135 }
135 }
General Comments 0
You need to be logged in to leave comments. Login now