Rollup merge of #33522 - mbrubeck:inline-rawvec-cap, r=nagisa

Inline RawVec::cap

This was showing up in a Servo profile.
This commit is contained in:
Steve Klabnik 2016-05-11 09:27:43 -04:00
commit 30df9d0201

View File

@ -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