From f118e9d7cb88e22ac467cc208b6e08c364eca14f Mon Sep 17 00:00:00 2001 From: mental Date: Sat, 12 Aug 2006 15:34:39 +0000 Subject: [PATCH] separate invariant check from main logic for clarity --- share/extensions/simplepath.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/extensions/simplepath.rb b/share/extensions/simplepath.rb index 466a75d10..3d9b7b372 100755 --- a/share/extensions/simplepath.rb +++ b/share/extensions/simplepath.rb @@ -78,9 +78,9 @@ def parsePath(d) lastCommand = nil lexPath(d) do |token, isCommand| - if command - raise 'Invalid number of parameters' if isCommand - else + raise 'Invalid number of parameters' if command and isCommand + + unless command if isCommand raise 'Invalid path, must begin with moveto.' \ unless lastCommand or token.upcase == 'M' -- 2.30.2