lib/url_regexp/path.rb in url_regexp-0.1.3 vs lib/url_regexp/path.rb in url_regexp-0.1.4

- old
+ new

@@ -33,20 +33,20 @@ elsif @parent.nil? _, label, rest = path.split('/', 3) else label, rest = path.split('/', 2) end - if label - p = @paths.find { |pp| pp.label == label } - if p.nil? - p = Path.new(label, self, @options) - @paths.append(p) - end - if rest.nil? - p.path_end = true - else - p.append(rest) - end + return if label.nil? + + p = @paths.find { |pp| pp.label == label } + if p.nil? + p = Path.new(label, self, @options) + @paths.append(p) + end + if rest.nil? + p.path_end = true + else + p.append(rest) end end def to_regexp_s s = @paths.to_regexp_s