Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
spuun committed Nov 13, 2024
1 parent 5e7e509 commit 2ca05de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/lavinmq/http/controller.cr
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ module LavinMQ
return iterator unless raw_name = params["name"]?
term = URI.decode_www_form(raw_name)
if params["use_regex"]?.try { |v| v == "true" }
iterator.select { |v| v[:name].to_s =~ /#{term}/ }
iterator.select &.[:name].to_s.matches?(/#{term}/)
else
iterator.select { |v| v[:name].to_s.includes?(term) }
iterator.select &.[:name].to_s.includes?(term)
end
end

Expand All @@ -45,7 +45,7 @@ module LavinMQ
if sort_by = params.fetch("sort", nil)
sorted_items = all_items.to_a
filtered_count = sorted_items.size
sorted_items.sort_by! { |i| i.dig?(sort_by) }
sorted_items.sort_by! &.dig?(sort_by)
sorted_items.reverse! if params["sort_reverse"]?.try { |s| !(s =~ /^false$/i) }
all_items = sorted_items.each
end
Expand Down
2 changes: 1 addition & 1 deletion src/lavinmq/metadata.cr
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module LavinMQ
end
{% end %}

return 0
0
end

delegate to_json, to_s, to: @value
Expand Down

0 comments on commit 2ca05de

Please sign in to comment.