Skip to content

Commit

Permalink
Rollup merge of rust-lang#33522 - mbrubeck:inline-rawvec-cap, r=nagisa
Browse files Browse the repository at this point in the history
Inline RawVec::cap

This was showing up in a Servo profile.
  • Loading branch information
steveklabnik committed May 11, 2016
2 parents 4fe7871 + 06f5fa4 commit 30df9d0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/liballoc/raw_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ impl<T> RawVec<T> {
/// Gets the capacity of the allocation.
///
/// This will always be `usize::MAX` if `T` is zero-sized.
#[inline(always)]
pub fn cap(&self) -> usize {
if mem::size_of::<T>() == 0 {
!0
Expand Down

0 comments on commit 30df9d0

Please sign in to comment.