mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-28 22:08:11 +08:00
Inline status cell calls
This commit is contained in:
@@ -478,10 +478,12 @@ impl StatusCell {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
pub fn no_partial() -> Self {
|
pub fn no_partial() -> Self {
|
||||||
Self { no_partial: true, ..Self::new() }
|
Self { no_partial: true, ..Self::new() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
pub fn eval_input<Input, N: Node<Input>>(&self, input_index: usize, node: &N, input: &Input) -> Result<N::Output, Interrupt> {
|
pub fn eval_input<Input, N: Node<Input>>(&self, input_index: usize, node: &N, input: &Input) -> Result<N::Output, Interrupt> {
|
||||||
match node.eval(input) {
|
match node.eval(input) {
|
||||||
GPoll::Final(value) => Ok(value),
|
GPoll::Final(value) => Ok(value),
|
||||||
@@ -506,6 +508,7 @@ impl StatusCell {
|
|||||||
|
|
||||||
/// A new cell holding a copy of the accumulated status; the error stays in
|
/// A new cell holding a copy of the accumulated status; the error stays in
|
||||||
/// place, cloned rather than taken.
|
/// place, cloned rather than taken.
|
||||||
|
#[inline(always)]
|
||||||
pub fn snapshot(&self) -> StatusCell {
|
pub fn snapshot(&self) -> StatusCell {
|
||||||
let error = self.error.take();
|
let error = self.error.take();
|
||||||
self.error.set(error.clone());
|
self.error.set(error.clone());
|
||||||
@@ -516,6 +519,7 @@ impl StatusCell {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
pub fn finish<T>(self, value: T) -> GPoll<T> {
|
pub fn finish<T>(self, value: T) -> GPoll<T> {
|
||||||
match (self.error.take(), self.finality.get()) {
|
match (self.error.take(), self.finality.get()) {
|
||||||
(Some(error), _) => GPoll::Fallback(Box::new((value, error))),
|
(Some(error), _) => GPoll::Fallback(Box::new((value, error))),
|
||||||
@@ -524,6 +528,7 @@ impl StatusCell {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
pub fn merge<T>(self, poll: GPoll<T>) -> GPoll<T> {
|
pub fn merge<T>(self, poll: GPoll<T>) -> GPoll<T> {
|
||||||
match poll {
|
match poll {
|
||||||
GPoll::Final(value) => self.finish(value),
|
GPoll::Final(value) => self.finish(value),
|
||||||
@@ -554,6 +559,7 @@ impl<'a, N> LazyInput<'a, N> {
|
|||||||
Self { node, cell, input_index }
|
Self { node, cell, input_index }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
pub fn eval<Input>(&self, ctx: &Input) -> Result<N::Output, Interrupt>
|
pub fn eval<Input>(&self, ctx: &Input) -> Result<N::Output, Interrupt>
|
||||||
where
|
where
|
||||||
N: Node<Input>,
|
N: Node<Input>,
|
||||||
@@ -563,6 +569,7 @@ impl<'a, N> LazyInput<'a, N> {
|
|||||||
|
|
||||||
/// The edge's composite extent, for kernels that split or shift indices
|
/// The edge's composite extent, for kernels that split or shift indices
|
||||||
/// over their sources.
|
/// over their sources.
|
||||||
|
#[inline(always)]
|
||||||
pub fn extent<Input>(&self, ctx: &Input, at: Level) -> GPoll<Extent>
|
pub fn extent<Input>(&self, ctx: &Input, at: Level) -> GPoll<Extent>
|
||||||
where
|
where
|
||||||
N: Node<Input>,
|
N: Node<Input>,
|
||||||
|
|||||||
Reference in New Issue
Block a user