Skip to content

Commit

Permalink
short-circuit list traversal with Enum.empty?
Browse files Browse the repository at this point in the history
  • Loading branch information
mashton committed Sep 4, 2024
1 parent ec2f0a5 commit b739ec4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ defmodule OpentelemetryBroadway do
} = metadata,
_config
) do
status = if length(failed_messages) == 0 do
status = if Enum.empty?(failed_messages) do
OpenTelemetry.status(:ok)
else
OpenTelemetry.status(:error, "Batch completed with failed messages")
Expand Down

0 comments on commit b739ec4

Please sign in to comment.