Rename hash_def_id to hash_node_id
This commit is contained in:
parent
d2362599d6
commit
b723082cdb
src/comp/metadata
@ -51,7 +51,7 @@ fn maybe_find_item(int item_id, &ebml::doc items) -> option::t[ebml::doc] {
|
||||
ret ebml::be_uint_from_bytes(bytes, 0u, 4u) as int == item_id;
|
||||
}
|
||||
auto eqer = bind eq_item(_, item_id);
|
||||
auto found = lookup_hash(items, eqer, encoder::hash_def_id(item_id));
|
||||
auto found = lookup_hash(items, eqer, encoder::hash_node_id(item_id));
|
||||
if (vec::len(found) == 0u) {
|
||||
ret option::none[ebml::doc];
|
||||
} else { ret option::some[ebml::doc](found.(0)); }
|
||||
|
@ -18,7 +18,7 @@ import front::attr;
|
||||
|
||||
export def_to_str;
|
||||
export hash_path;
|
||||
export hash_def_id;
|
||||
export hash_node_id;
|
||||
export encode_metadata;
|
||||
|
||||
// Path table encoding
|
||||
@ -371,7 +371,7 @@ fn encode_info_for_items(&@crate_ctxt cx, &ebml::writer ebml_w) ->
|
||||
// Path and definition ID indexing
|
||||
|
||||
// djb's cdb hashes.
|
||||
fn hash_def_id(&int def_id) -> uint { ret 177573u ^ (def_id as uint); }
|
||||
fn hash_node_id(&int node_id) -> uint { ret 177573u ^ (node_id as uint); }
|
||||
|
||||
fn hash_path(&str s) -> uint {
|
||||
auto h = 5381u;
|
||||
@ -540,7 +540,7 @@ fn encode_metadata(&@crate_ctxt cx, &@crate crate) -> str {
|
||||
ebml::start_tag(ebml_w, tag_items);
|
||||
auto items_index = encode_info_for_items(cx, ebml_w);
|
||||
auto int_writer = write_int;
|
||||
auto item_hasher = hash_def_id;
|
||||
auto item_hasher = hash_node_id;
|
||||
auto items_buckets = create_index[int](items_index, item_hasher);
|
||||
encode_index[int](ebml_w, items_buckets, int_writer);
|
||||
ebml::end_tag(ebml_w);
|
||||
|
Loading…
x
Reference in New Issue
Block a user