Skip to content

Commit ad447f5

Browse files
committed
---
yaml --- r: 153014 b: refs/heads/try2 c: c1ff089 h: refs/heads/master v: v3
1 parent b3db1e4 commit ad447f5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 8284ef63a517690a893ffda1083fb966a76b6fbc
8+
refs/heads/try2: c1ff089c275592044057841673256ec78d6c400c
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/collections/hashmap.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,11 +1033,13 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> MutableMap<K, V> for HashMap<K, V, H>
10331033

10341034
impl<K: Hash + Eq, V> HashMap<K, V, RandomSipHasher> {
10351035
/// Create an empty HashMap.
1036+
#[inline]
10361037
pub fn new() -> HashMap<K, V, RandomSipHasher> {
10371038
HashMap::with_capacity(INITIAL_CAPACITY)
10381039
}
10391040

10401041
/// Creates an empty hash map with the given initial capacity.
1042+
#[inline]
10411043
pub fn with_capacity(capacity: uint) -> HashMap<K, V, RandomSipHasher> {
10421044
let hasher = RandomSipHasher::new();
10431045
HashMap::with_capacity_and_hasher(capacity, hasher)
@@ -1048,6 +1050,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
10481050
/// Creates an empty hashmap which will use the given hasher to hash keys.
10491051
///
10501052
/// The creates map has the default initial capacity.
1053+
#[inline]
10511054
pub fn with_hasher(hasher: H) -> HashMap<K, V, H> {
10521055
HashMap::with_capacity_and_hasher(INITIAL_CAPACITY, hasher)
10531056
}
@@ -1059,6 +1062,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
10591062
/// is designed to allow HashMaps to be resistant to attacks that
10601063
/// cause many collisions and very poor performance. Setting it
10611064
/// manually using this function can expose a DoS attack vector.
1065+
#[inline]
10621066
pub fn with_capacity_and_hasher(capacity: uint, hasher: H) -> HashMap<K, V, H> {
10631067
let cap = num::next_power_of_two(max(INITIAL_CAPACITY, capacity));
10641068
HashMap {
@@ -1526,12 +1530,14 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> MutableSet<T> for HashSet<T, H> {
15261530

15271531
impl<T: Hash + Eq> HashSet<T, RandomSipHasher> {
15281532
/// Create an empty HashSet
1533+
#[inline]
15291534
pub fn new() -> HashSet<T, RandomSipHasher> {
15301535
HashSet::with_capacity(INITIAL_CAPACITY)
15311536
}
15321537

15331538
/// Create an empty HashSet with space for at least `n` elements in
15341539
/// the hash table.
1540+
#[inline]
15351541
pub fn with_capacity(capacity: uint) -> HashSet<T, RandomSipHasher> {
15361542
HashSet { map: HashMap::with_capacity(capacity) }
15371543
}
@@ -1542,6 +1548,7 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
15421548
/// keys.
15431549
///
15441550
/// The hash set is also created with the default initial capacity.
1551+
#[inline]
15451552
pub fn with_hasher(hasher: H) -> HashSet<T, H> {
15461553
HashSet::with_capacity_and_hasher(INITIAL_CAPACITY, hasher)
15471554
}
@@ -1553,6 +1560,7 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> {
15531560
/// is designed to allow `HashSet`s to be resistant to attacks that
15541561
/// cause many collisions and very poor performance. Setting it
15551562
/// manually using this function can expose a DoS attack vector.
1563+
#[inline]
15561564
pub fn with_capacity_and_hasher(capacity: uint, hasher: H) -> HashSet<T, H> {
15571565
HashSet { map: HashMap::with_capacity_and_hasher(capacity, hasher) }
15581566
}

0 commit comments

Comments
 (0)