rename hashmap find_ref/get_ref -> find/get
This commit is contained in:
parent
203fcbd0f3
commit
ee0a8c68ab
3 changed files with 10 additions and 10 deletions
|
@ -369,7 +369,7 @@ pub mod linear {
|
|||
}
|
||||
}
|
||||
|
||||
pure fn find_ref(&self, k: &K) -> Option<&self/V> {
|
||||
pure fn find(&self, k: &K) -> Option<&self/V> {
|
||||
match self.bucket_for_key(self.buckets, k) {
|
||||
FoundEntry(idx) => {
|
||||
match self.buckets[idx] {
|
||||
|
@ -389,8 +389,8 @@ pub mod linear {
|
|||
}
|
||||
}
|
||||
|
||||
pure fn get_ref(&self, k: &K) -> &self/V {
|
||||
match self.find_ref(k) {
|
||||
pure fn get(&self, k: &K) -> &self/V {
|
||||
match self.find(k) {
|
||||
Some(v) => v,
|
||||
None => fail fmt!("No entry found for key: %?", k),
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ pub mod linear {
|
|||
if self.len() != other.len() { return false; }
|
||||
|
||||
for self.each |key, value| {
|
||||
match other.find_ref(key) {
|
||||
match other.find(key) {
|
||||
None => return false,
|
||||
Some(v) => if value != v { return false },
|
||||
}
|
||||
|
@ -593,11 +593,11 @@ pub mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
pub fn find_ref() {
|
||||
pub fn find() {
|
||||
let mut m = ~LinearMap();
|
||||
assert m.find_ref(&1).is_none();
|
||||
assert m.find(&1).is_none();
|
||||
m.insert(1, 2);
|
||||
match m.find_ref(&1) {
|
||||
match m.find(&1) {
|
||||
None => fail,
|
||||
Some(v) => assert *v == 2
|
||||
}
|
||||
|
|
|
@ -911,7 +911,7 @@ pub impl Decoder: serialize::Decoder {
|
|||
// FIXME(#3148) This hint should not be necessary.
|
||||
let obj: &self/~Object = obj;
|
||||
|
||||
match obj.find_ref(&name.to_owned()) {
|
||||
match obj.find(&name.to_owned()) {
|
||||
None => fail fmt!("no such field: %s", name),
|
||||
Some(json) => {
|
||||
self.stack.push(json);
|
||||
|
@ -969,7 +969,7 @@ impl Json : Eq {
|
|||
if d0.len() == d1.len() {
|
||||
let mut equal = true;
|
||||
for d0.each |k, v0| {
|
||||
match d1.find_ref(k) {
|
||||
match d1.find(k) {
|
||||
Some(v1) if v0 == v1 => { },
|
||||
_ => { equal = false; break }
|
||||
}
|
||||
|
|
|
@ -297,7 +297,7 @@ impl @Mut<Prep> : TPrep {
|
|||
name: &str, val: &str) -> bool {
|
||||
do self.borrow_imm |p| {
|
||||
let k = kind.to_owned();
|
||||
let f = (*p.ctxt.freshness.get_ref(&k))(name, val);
|
||||
let f = (*p.ctxt.freshness.get(&k))(name, val);
|
||||
do p.ctxt.logger.borrow_imm |lg| {
|
||||
if f {
|
||||
lg.info(fmt!("%s %s:%s is fresh",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue