From b723082cdb2d5793c103f64f9709639f97e31c61 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 7 Jul 2011 12:12:25 -0700 Subject: [PATCH] Rename hash_def_id to hash_node_id --- src/comp/metadata/decoder.rs | 2 +- src/comp/metadata/encoder.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/comp/metadata/decoder.rs b/src/comp/metadata/decoder.rs index 558aacce81a..b8174139e5e 100644 --- a/src/comp/metadata/decoder.rs +++ b/src/comp/metadata/decoder.rs @@ -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)); } diff --git a/src/comp/metadata/encoder.rs b/src/comp/metadata/encoder.rs index 8a44310415c..dc7c3927992 100644 --- a/src/comp/metadata/encoder.rs +++ b/src/comp/metadata/encoder.rs @@ -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);