[librsvg: 17/45] Simplify the while loop in NodeGradient::resolve()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 17/45] Simplify the while loop in NodeGradient::resolve()
- Date: Tue, 1 Oct 2019 15:08:22 +0000 (UTC)
commit b6d48d55361a208d1ac53780a07d45b5251ff1d6
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Sep 27 14:43:39 2019 -0500
Simplify the while loop in NodeGradient::resolve()
Make it better match the structure of the same loop in NodePattern::resolve()
rsvg_internals/src/gradient.rs | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/rsvg_internals/src/gradient.rs b/rsvg_internals/src/gradient.rs
index 47b7182c..7457a7f0 100644
--- a/rsvg_internals/src/gradient.rs
+++ b/rsvg_internals/src/gradient.rs
@@ -669,9 +669,7 @@ impl PaintSource for NodeGradient {
let mut stack = NodeStack::new();
while !result.is_resolved() {
- let acquired = acquire_gradient(draw_ctx, result.fallback.as_ref());
-
- if let Some(acquired) = acquired {
+ if let Some(acquired) = acquire_gradient(draw_ctx, result.fallback.as_ref()) {
let a_node = acquired.get();
if stack.contains(a_node) {
@@ -684,11 +682,9 @@ impl PaintSource for NodeGradient {
result.resolve_from_fallback(&a_gradient);
stack.push(a_node);
-
- continue;
+ } else {
+ result.resolve_from_defaults();
}
-
- result.resolve_from_defaults();
}
if result.common.bounds_are_valid(bbox) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]