From ba4fc75ae783e6d5b657264af3349dfd6c087832 Mon Sep 17 00:00:00 2001 From: Yevhenii Reizner Date: Sat, 30 Oct 2021 17:28:19 +0300 Subject: [PATCH] Inline more. --- src/ggg/chained_context.rs | 1 + src/ggg/context.rs | 1 + src/ggg/lookup.rs | 1 + src/tables/cmap/mod.rs | 2 ++ src/tables/gpos.rs | 3 +++ src/tables/gsub.rs | 3 +++ 6 files changed, 11 insertions(+) diff --git a/src/ggg/chained_context.rs b/src/ggg/chained_context.rs index a46079f2..1d2eb2c1 100644 --- a/src/ggg/chained_context.rs +++ b/src/ggg/chained_context.rs @@ -80,6 +80,7 @@ impl<'a> ChainedContextLookup<'a> { } /// Returns the subtable coverage. + #[inline] pub fn coverage(&self) -> Coverage<'a> { match self { Self::Format1 { coverage, .. } => *coverage, diff --git a/src/ggg/context.rs b/src/ggg/context.rs index 5e72291a..10d99d0b 100644 --- a/src/ggg/context.rs +++ b/src/ggg/context.rs @@ -66,6 +66,7 @@ impl<'a> ContextLookup<'a> { } /// Returns the subtable coverage. + #[inline] pub fn coverage(&self) -> Coverage<'a> { match self { Self::Format1 { coverage, .. } => *coverage, diff --git a/src/ggg/lookup.rs b/src/ggg/lookup.rs index d3d56bd6..057cc8af 100644 --- a/src/ggg/lookup.rs +++ b/src/ggg/lookup.rs @@ -59,6 +59,7 @@ impl core::fmt::Debug for LookupSubtables<'_> { impl<'a> LookupSubtables<'a> { /// Returns a number of items in the LookupSubtables. + #[inline] pub fn len(&self) -> u16 { self.offsets.len() } diff --git a/src/tables/cmap/mod.rs b/src/tables/cmap/mod.rs index ed2b836e..de2142ce 100644 --- a/src/tables/cmap/mod.rs +++ b/src/tables/cmap/mod.rs @@ -214,6 +214,7 @@ impl<'a> Subtables<'a> { } /// Returns the number + #[inline] pub fn len(&self) -> u16 { self.records.len() } @@ -242,6 +243,7 @@ pub struct SubtablesIter<'a> { impl<'a> Iterator for SubtablesIter<'a> { type Item = Subtable<'a>; + #[inline] fn next(&mut self) -> Option { if self.index < self.subtables.len() { self.index += 1; diff --git a/src/tables/gpos.rs b/src/tables/gpos.rs index dd650421..a2dc77bd 100644 --- a/src/tables/gpos.rs +++ b/src/tables/gpos.rs @@ -317,6 +317,7 @@ impl<'a> SingleAdjustment<'a> { } /// Returns the subtable coverage. + #[inline] pub fn coverage(&self) -> Coverage<'a> { match self { Self::Format1 { coverage, .. } => *coverage, @@ -549,6 +550,7 @@ impl<'a> PairAdjustment<'a> { } /// Returns the subtable coverage. + #[inline] pub fn coverage(&self) -> Coverage<'a> { match self { Self::Format1 { coverage, .. } => *coverage, @@ -936,6 +938,7 @@ impl<'a> LookupSubtable<'a> for PositioningSubtable<'a> { impl<'a> PositioningSubtable<'a> { /// Returns the subtable coverage. + #[inline] pub fn coverage(&self) -> Coverage<'a> { match self { Self::Single(t) => t.coverage(), diff --git a/src/tables/gsub.rs b/src/tables/gsub.rs index 730c615e..7f897041 100644 --- a/src/tables/gsub.rs +++ b/src/tables/gsub.rs @@ -42,6 +42,7 @@ impl<'a> SingleSubstitution<'a> { } /// Returns the subtable coverage. + #[inline] pub fn coverage(&self) -> Coverage<'a> { match self { Self::Format1 { coverage, .. } => *coverage, @@ -272,6 +273,7 @@ impl<'a> LookupSubtable<'a> for SubstitutionSubtable<'a> { impl<'a> SubstitutionSubtable<'a> { /// Returns the subtable coverage. + #[inline] pub fn coverage(&self) -> Coverage<'a> { match self { Self::Single(t) => t.coverage(), @@ -285,6 +287,7 @@ impl<'a> SubstitutionSubtable<'a> { } /// Checks that the current subtable is *Reverse Chaining Contextual Single*. + #[inline] pub fn is_reverse(&self) -> bool { matches!(self, Self::ReverseChainSingle(_)) }