mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Inline nsTArray::deref.
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
610ebe2e25
commit
b8d46406f6
1 changed files with 1 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue