mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 09:54:42 +00:00
Bug 1684673 - Inline nsTArray::deref. r=xidorn
This shaves >50ms if the compiler decides not to inline it, compilers are sometimes dumb. Depends on D100593 Differential Revision: https://phabricator.services.mozilla.com/D100594
This commit is contained in:
parent
c260c526dc
commit
38bd2ea5d8
@ -13,6 +13,7 @@ use std::slice;
|
||||
impl<T> Deref for nsTArray<T> {
|
||||
type Target = [T];
|
||||
|
||||
#[inline]
|
||||
fn deref<'a>(&'a self) -> &'a [T] {
|
||||
unsafe { slice::from_raw_parts(self.slice_begin(), self.header().mLength as usize) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user