Skip to content

Commit c491bf9

Browse files
committed
std: Camel case smallintmap
1 parent 200959d commit c491bf9

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

src/libstd/smallintmap.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ use map::map;
1212

1313
// FIXME (#2347): Should not be @; there's a bug somewhere in rustc that
1414
// requires this to be.
15-
type smallintmap_<T: copy> = {v: DVec<Option<T>>};
15+
type SmallIntMap_<T: copy> = {v: DVec<Option<T>>};
1616

17-
enum smallintmap<T:copy> {
18-
smallintmap_(@smallintmap_<T>)
17+
enum SmallIntMap<T:copy> {
18+
SmallIntMap_(@SmallIntMap_<T>)
1919
}
2020

2121
/// Create a smallintmap
22-
fn mk<T: copy>() -> smallintmap<T> {
22+
fn mk<T: copy>() -> SmallIntMap<T> {
2323
let v = DVec();
24-
return smallintmap_(@{v: v});
24+
return SmallIntMap_(@{v: v});
2525
}
2626

2727
/**
2828
* Add a value to the map. If the map already contains a value for
2929
* the specified key then the original value is replaced.
3030
*/
3131
#[inline(always)]
32-
fn insert<T: copy>(self: smallintmap<T>, key: uint, +val: T) {
32+
fn insert<T: copy>(self: SmallIntMap<T>, key: uint, +val: T) {
3333
//io::println(fmt!("%?", key));
3434
self.v.grow_set_elt(key, None, Some(val));
3535
}
@@ -38,7 +38,7 @@ fn insert<T: copy>(self: smallintmap<T>, key: uint, +val: T) {
3838
* Get the value for the specified key. If the key does not exist
3939
* in the map then returns none
4040
*/
41-
pure fn find<T: copy>(self: smallintmap<T>, key: uint) -> Option<T> {
41+
pure fn find<T: copy>(self: SmallIntMap<T>, key: uint) -> Option<T> {
4242
if key < self.v.len() { return self.v.get_elt(key); }
4343
return None::<T>;
4444
}
@@ -50,7 +50,7 @@ pure fn find<T: copy>(self: smallintmap<T>, key: uint) -> Option<T> {
5050
*
5151
* If the key does not exist in the map
5252
*/
53-
pure fn get<T: copy>(self: smallintmap<T>, key: uint) -> T {
53+
pure fn get<T: copy>(self: SmallIntMap<T>, key: uint) -> T {
5454
match find(self, key) {
5555
None => {
5656
error!("smallintmap::get(): key not present");
@@ -61,12 +61,12 @@ pure fn get<T: copy>(self: smallintmap<T>, key: uint) -> T {
6161
}
6262

6363
/// Returns true if the map contains a value for the specified key
64-
fn contains_key<T: copy>(self: smallintmap<T>, key: uint) -> bool {
64+
fn contains_key<T: copy>(self: SmallIntMap<T>, key: uint) -> bool {
6565
return !option::is_none(find(self, key));
6666
}
6767

6868
/// Implements the map::map interface for smallintmap
69-
impl<V: copy> smallintmap<V>: map::map<uint, V> {
69+
impl<V: copy> SmallIntMap<V>: map::map<uint, V> {
7070
pure fn size() -> uint {
7171
let mut sz = 0u;
7272
for self.v.each |item| {
@@ -137,7 +137,7 @@ impl<V: copy> smallintmap<V>: map::map<uint, V> {
137137
}
138138
}
139139

140-
impl<V: copy> smallintmap<V>: ops::Index<uint, V> {
140+
impl<V: copy> SmallIntMap<V>: ops::Index<uint, V> {
141141
pure fn index(&&key: uint) -> V {
142142
unchecked {
143143
get(self, key)
@@ -146,6 +146,6 @@ impl<V: copy> smallintmap<V>: ops::Index<uint, V> {
146146
}
147147

148148
/// Cast the given smallintmap to a map::map
149-
fn as_map<V: copy>(s: smallintmap<V>) -> map::map<uint, V> {
149+
fn as_map<V: copy>(s: SmallIntMap<V>) -> map::map<uint, V> {
150150
s as map::map::<uint, V>
151151
}

src/libstd/std.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ mod list;
6565
#[allow(non_camel_case_types)] // XXX
6666
mod map;
6767
mod rope;
68-
#[allow(non_camel_case_types)] // XXX
6968
mod smallintmap;
7069
mod sort;
7170
mod treemap;

src/rustc/middle/lint.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use syntax::{ast, ast_util, visit};
55
use syntax::attr;
66
use syntax::codemap::span;
77
use std::map::{map,hashmap,int_hash,hash_from_strs};
8-
use std::smallintmap::{map,smallintmap};
8+
use std::smallintmap::{map,SmallIntMap};
99
use io::WriterUtil;
1010
use util::ppaux::{ty_to_str};
1111
use middle::pat_util::{pat_bindings};
@@ -187,7 +187,7 @@ fn get_lint_dict() -> lint_dict {
187187
}
188188

189189
// This is a highly not-optimal set of data structure decisions.
190-
type lint_modes = smallintmap<level>;
190+
type lint_modes = SmallIntMap<level>;
191191
type lint_mode_map = hashmap<ast::node_id, lint_modes>;
192192

193193
// settings_map maps node ids of items with non-default lint settings
@@ -223,7 +223,7 @@ fn get_lint_settings_level(settings: lint_settings,
223223
// This is kind of unfortunate. It should be somewhere else, or we should use
224224
// a persistent data structure...
225225
fn clone_lint_modes(modes: lint_modes) -> lint_modes {
226-
std::smallintmap::smallintmap_(@{v: copy modes.v})
226+
std::smallintmap::SmallIntMap_(@{v: copy modes.v})
227227
}
228228

229229
type ctxt_ = {dict: lint_dict,

src/rustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ type type_cache = hashmap<ast::def_id, ty_param_bounds_and_ty>;
640640

641641
type constness_cache = hashmap<ast::def_id, const_eval::constness>;
642642

643-
type node_type_table = @smallintmap::smallintmap<t>;
643+
type node_type_table = @smallintmap::SmallIntMap<t>;
644644

645645
fn mk_rcache() -> creader_cache {
646646
type val = {cnum: int, pos: uint, len: uint};

src/rustc/middle/typeck/infer/unify.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
use combine::combine;
22
use integral::*;
33
use to_str::to_str;
4+
use std::smallintmap::SmallIntMap;
45

56
enum var_value<V:copy, T:copy> {
67
redirect(V),
78
root(T, uint),
89
}
910

1011
struct vals_and_bindings<V:copy, T:copy> {
11-
vals: smallintmap<var_value<V, T>>;
12+
vals: SmallIntMap<var_value<V, T>>;
1213
mut bindings: ~[(V, var_value<V, T>)];
1314
}
1415

0 commit comments

Comments
 (0)