refactor libcollections as part of collection reform

* Moves multi-collection files into their own directory, and splits them into seperate files
* Changes exports so that each collection has its own module
* Adds underscores to public modules and filenames to match standard naming conventions

(that is, treemap::{TreeMap, TreeSet} => tree_map::TreeMap, tree_set::TreeSet)

* Renames PriorityQueue to BinaryHeap
* Renames SmallIntMap to VecMap
* Miscellanious fallout fixes

[breaking-change]
This commit is contained in:
Alexis Beingessner 2014-10-30 21:25:08 -04:00
parent a294b35060
commit 112c8a966f
48 changed files with 1797 additions and 1706 deletions

View file

@ -13,17 +13,17 @@
extern crate collections;
extern crate time;
use std::collections::SmallIntMap;
use std::collections::VecMap;
use std::os;
use std::uint;
fn append_sequential(min: uint, max: uint, map: &mut SmallIntMap<uint>) {
fn append_sequential(min: uint, max: uint, map: &mut VecMap<uint>) {
for i in range(min, max) {
map.insert(i, i + 22u);
}
}
fn check_sequential(min: uint, max: uint, map: &SmallIntMap<uint>) {
fn check_sequential(min: uint, max: uint, map: &VecMap<uint>) {
for i in range(min, max) {
assert_eq!(map[i], i + 22u);
}
@ -45,7 +45,7 @@ fn main() {
let mut appendf = 0.0;
for _ in range(0u, rep) {
let mut map = SmallIntMap::new();
let mut map = VecMap::new();
let start = time::precise_time_s();
append_sequential(0u, max, &mut map);
let mid = time::precise_time_s();