[librsvg: 12/19] Simplify logic in PathParser::should_break_arg_sequence()




commit e11b383a7ef85f211fce40df95e603083f3d5bb6
Author: Sven Neumann <sven svenfoo org>
Date:   Fri Aug 21 00:55:16 2020 +0200

    Simplify logic in PathParser::should_break_arg_sequence()
    
    See https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
    and https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool

 rsvg_internals/src/path_parser.rs | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/rsvg_internals/src/path_parser.rs b/rsvg_internals/src/path_parser.rs
index d88c45e8d..3b491bd01 100644
--- a/rsvg_internals/src/path_parser.rs
+++ b/rsvg_internals/src/path_parser.rs
@@ -635,12 +635,9 @@ impl<'b> PathParser<'b> {
             // if there is a comma (indicating we should continue to loop), eat the comma
             // so we're ready at the next start of the loop to process the next token.
             false
-        } else if !self.peek_number().is_some() {
-            // if the next token is not a number or a comma, we do want to break the loop
-            true
         } else {
-            // otherwise, continue to loop to process args in the sequence.
-            false
+            // continue to process args in the sequence unless the next token is a comma
+            self.peek_number().is_none()
         }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]