Skip to content

Commit

Permalink
auto merge of #5476 : thestinger/rust/bench, r=graydon
Browse files Browse the repository at this point in the history
The old string benchmarks weren't very useful because the strings weren't long enough, so I just threw those out for now. I left out benchmarks of `oldmap` because it's clear that it's 30-40% slower and it doesn't implement the `Map` trait.

This also cleanly divides up `insert`, `search` and `remove`.
  • Loading branch information
bors committed Mar 22, 2013
2 parents ec8345b + 5acfe3d commit 80d47fd
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 250 deletions.
4 changes: 1 addition & 3 deletions src/libcore/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,13 @@ impl<T> Map<uint, T> for TrieMap<T> {
}
}

impl<T> TrieMap<T> {
pub impl<T> TrieMap<T> {
/// Create an empty TrieMap
#[inline(always)]
static pure fn new() -> TrieMap<T> {
TrieMap{root: TrieNode::new(), length: 0}
}
}

impl<T> TrieMap<T> {
/// Visit all keys in reverse order
#[inline(always)]
pure fn each_key_reverse(&self, f: &fn(&uint) -> bool) {
Expand Down
Loading

0 comments on commit 80d47fd

Please sign in to comment.