Skip to content

Commit

Permalink
Fix breaking globs
Browse files Browse the repository at this point in the history
  • Loading branch information
HarbinsonAdam committed Nov 12, 2024
1 parent 9d687c6 commit 18c318f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lucky_router/fragment.cr
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ class LuckyRouter::Fragment(T)
end

def add_part(path_part : PathPart) : Fragment(T)
if glob_part = self.glob_part
return glob_part
elsif path_part.glob?
self.glob_part = Fragment(T).new(path_part: path_part)
if path_part.glob?
self.glob_part ||= Fragment(T).new(path_part: path_part)
elsif path_part.path_variable?
existing = self.dynamic_parts.find { |fragment| fragment.path_part == path_part }
return existing if existing
Expand Down

0 comments on commit 18c318f

Please sign in to comment.