Skip to content

Commit 5b933ae

Browse files
committed
auto merge of #5696 : thestinger/rust/hashmap, r=sanxiyn
This naming is free now that `oldmap` has finally been removed, so this is a search-and-replace to take advantage of that. It might as well be called `HashMap` instead of being named after the specific implementation, since there's only one. SipHash distributes keys so well that I don't think there will ever be much need to use anything but a simple hash table with open addressing. If there *is* a better way to do it, it will probably be better in all cases and can just be the default implementation. A cuckoo-hashing implementation combining a weaker hash with SipHash could be useful, but that won't be as general purpose - you would need to write a separate fast hash function specialized for the type to really take advantage of it (like taking a page from libstdc++/libc++ and just using the integer value as the "hash"). I think a more specific naming for a truly alternative implementation like that would be fine, with the nice naming reserved for the general purpose container.
2 parents 6153aae + cc148b5 commit 5b933ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1305
-1309
lines changed

doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,10 @@ expression context, the final namespace qualifier is omitted.
441441
Two examples of paths with type arguments:
442442

443443
~~~~
444-
# use core::hashmap::linear::LinearMap;
444+
# use core::hashmap::HashMap;
445445
# fn f() {
446446
# fn id<T:Copy>(t: T) -> T { t }
447-
type t = LinearMap<int,~str>; // Type arguments used in a type expression
447+
type t = HashMap<int,~str>; // Type arguments used in a type expression
448448
let x = id::<int>(10); // Type arguments used in a call expression
449449
# }
450450
~~~~

doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,8 +1888,8 @@ illegal to copy and pass by value.
18881888
Generic `type`, `struct`, and `enum` declarations follow the same pattern:
18891889

18901890
~~~~
1891-
# use core::hashmap::linear::LinearMap;
1892-
type Set<T> = LinearMap<T, ()>;
1891+
# use core::hashmap::HashMap;
1892+
type Set<T> = HashMap<T, ()>;
18931893
18941894
struct Stack<T> {
18951895
elements: ~[T]

src/libcore/gc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use io;
4343
use libc::{size_t, uintptr_t};
4444
use option::{None, Option, Some};
4545
use ptr;
46-
use hashmap::linear::LinearSet;
46+
use hashmap::HashSet;
4747
use stackwalk;
4848
use sys;
4949

@@ -344,7 +344,7 @@ pub fn cleanup_stack_for_failure() {
344344
ptr::null()
345345
};
346346

347-
let mut roots = LinearSet::new();
347+
let mut roots = HashSet::new();
348348
for walk_gc_roots(need_cleanup, sentinel) |root, tydesc| {
349349
// Track roots to avoid double frees.
350350
if roots.contains(&*root) {

0 commit comments

Comments
 (0)