oldmap: &K instead of K for the remove parameter

This commit is contained in:
Daniel Micay 2013-02-03 17:12:33 -05:00
parent 119c78073b
commit 4fd9264875
6 changed files with 12 additions and 12 deletions

View File

@ -1687,7 +1687,7 @@ pub fn cmd_sources(c: &Cargo) {
match action {
~"clear" => {
for c.sources.each_key_ref |&k| {
c.sources.remove(k);
c.sources.remove(&k);
}
info(~"cleared sources");
@ -1734,7 +1734,7 @@ pub fn cmd_sources(c: &Cargo) {
}
if c.sources.contains_key_ref(&name) {
c.sources.remove(name);
c.sources.remove(&name);
info(fmt!("removed source: %s", name));
} else {
error(fmt!("no such source: %s", name));
@ -1825,7 +1825,7 @@ pub fn cmd_sources(c: &Cargo) {
match c.sources.find(name) {
Some(source) => {
c.sources.remove(name);
c.sources.remove(&name);
c.sources.insert(newn, source);
info(fmt!("renamed source: %s to %s", name, newn));
}

View File

@ -1198,7 +1198,7 @@ pub fn compile_guard(bcx: block,
}
TrByRef | TrByImplicitRef => {}
}
bcx.fcx.lllocals.remove(binding_info.id);
bcx.fcx.lllocals.remove(&binding_info.id);
}
return bcx;
}

View File

@ -712,11 +712,11 @@ pub impl RegionVarBindings {
assert self.var_spans.len() == *vid + 1;
self.var_spans.pop();
}
AddConstraint(constraint) => {
AddConstraint(ref constraint) => {
self.constraints.remove(constraint);
}
AddCombination(map, ref regions) => {
map.remove((*regions));
map.remove(regions);
}
}
}

View File

@ -299,8 +299,8 @@ pub mod chained {
option::unwrap(move opt_v)
}
fn remove(k: K) -> bool {
match self.search_tbl(&k, k.hash_keyed(0,0) as uint) {
fn remove(k: &K) -> bool {
match self.search_tbl(k, k.hash_keyed(0,0) as uint) {
NotFound => false,
FoundFirst(idx, entry) => {
self.count -= 1u;
@ -578,7 +578,7 @@ mod tests {
debug!("removing evens");
i = 0u;
while i < num_to_insert {
let v = hm.remove(i);
let v = hm.remove(&i);
assert v;
i += 2u;
}

View File

@ -64,7 +64,7 @@ fn old_int_benchmarks(rng: @rand::Rng, num_keys: uint, results: &mut Results) {
do timed(&mut results.delete_ints) {
for uint::range(0, num_keys) |i| {
assert map.remove(i);
assert map.remove(&i);
}
}
}
@ -103,7 +103,7 @@ fn old_str_benchmarks(rng: @rand::Rng, num_keys: uint, results: &mut Results) {
}
do timed(&mut results.delete_strings) {
for uint::range(0, num_keys) |i| {
assert map.remove(uint::to_str(i, 10));
assert map.remove(&uint::to_str(i, 10));
}
}
}

View File

@ -138,7 +138,7 @@ fn writer(path: ~str, pport: pipes::Port<Line>, size: uint)
debug!("WS %u", prev);
cout.write(lines.get(prev));
done += 1_u;
lines.remove(prev);
lines.remove(&prev);
prev += 1_u;
}
else {