@@ -53,7 +53,7 @@ pub struct Node<K, V> {
53
53
// hard. For now, we accept this cost in the name of correctness and simplicity.
54
54
//
55
55
// As a compromise, keys and vals could be merged into one Vec<(K, V)>, which would shave
56
- // off 3 words, but possibly hurt our cache effeciency during search, which only cares about
56
+ // off 3 words, but possibly hurt our cache efficiency during search, which only cares about
57
57
// keys. This would also avoid the Zip we use in our iterator implementations. This is
58
58
// probably worth investigating.
59
59
//
@@ -72,7 +72,7 @@ impl<K: Ord, V> Node<K, V> {
72
72
/// `GoDown` will be yielded with the index of the subtree the key must lie in.
73
73
pub fn search ( & self , key : & K ) -> SearchResult {
74
74
// FIXME(Gankro): Tune when to search linear or binary based on B (and maybe K/V).
75
- // For the B configured as of this writing (B = 6), binary search was *singnificantly *
75
+ // For the B configured as of this writing (B = 6), binary search was *significantly *
76
76
// worse for uints.
77
77
self . search_linear ( key)
78
78
}
@@ -375,7 +375,7 @@ impl<K, V> Node<K, V> {
375
375
}
376
376
}
377
377
378
- /// Steal! Stealing is roughly analagous to a binary tree rotation.
378
+ /// Steal! Stealing is roughly analogous to a binary tree rotation.
379
379
/// In this case, we're "rotating" right.
380
380
unsafe fn steal_to_left ( & mut self , underflowed_child_index : uint ) {
381
381
// Take the biggest stuff off left
@@ -387,7 +387,7 @@ impl<K, V> Node<K, V> {
387
387
}
388
388
} ;
389
389
390
- // Swap the parent's seperating key-value pair with left's
390
+ // Swap the parent's separating key-value pair with left's
391
391
self . unsafe_swap ( underflowed_child_index - 1 , & mut key, & mut val) ;
392
392
393
393
// Put them at the start of right
@@ -402,7 +402,7 @@ impl<K, V> Node<K, V> {
402
402
}
403
403
}
404
404
405
- /// Steal! Stealing is roughly analagous to a binary tree rotation.
405
+ /// Steal! Stealing is roughly analogous to a binary tree rotation.
406
406
/// In this case, we're "rotating" left.
407
407
unsafe fn steal_to_right ( & mut self , underflowed_child_index : uint ) {
408
408
// Take the smallest stuff off right
@@ -414,7 +414,7 @@ impl<K, V> Node<K, V> {
414
414
}
415
415
} ;
416
416
417
- // Swap the parent's seperating key-value pair with right's
417
+ // Swap the parent's separating key-value pair with right's
418
418
self . unsafe_swap ( underflowed_child_index, & mut key, & mut val) ;
419
419
420
420
// Put them at the end of left
@@ -430,9 +430,9 @@ impl<K, V> Node<K, V> {
430
430
}
431
431
432
432
/// Merge! Left and right will be smooshed into one node, along with the key-value
433
- /// pair that seperated them in their parent.
433
+ /// pair that separated them in their parent.
434
434
unsafe fn merge_children ( & mut self , left_index : uint ) {
435
- // Permanently remove right's index, and the key-value pair that seperates
435
+ // Permanently remove right's index, and the key-value pair that separates
436
436
// left and right
437
437
let ( key, val, right) = {
438
438
match ( self . keys . remove ( left_index) ,
@@ -448,7 +448,7 @@ impl<K, V> Node<K, V> {
448
448
left. absorb ( key, val, right) ;
449
449
}
450
450
451
- /// Take all the values from right, seperated by the given key and value
451
+ /// Take all the values from right, separated by the given key and value
452
452
fn absorb ( & mut self , key : K , val : V , right : Node < K , V > ) {
453
453
// Just as a sanity check, make sure we can fit this guy in
454
454
debug_assert ! ( self . len( ) + right. len( ) <= self . capacity( ) )
0 commit comments