Skip to content

Commit 5a68744

Browse files
committed
[Chore] Refactor code
1 parent 76eb287 commit 5a68744

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/kafka/consumer.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,10 @@ def clear_current_offsets(excluding: {})
593593
end
594594

595595
def scan_for_subscribing
596-
@subscribed_topics.keys.each do |topic_or_regex|
597-
default_offset = @subscribed_topics[topic_or_regex][:default_offset]
598-
start_from_beginning = @subscribed_topics[topic_or_regex][:start_from_beginning]
599-
max_bytes_per_partition = @subscribed_topics[topic_or_regex][:max_bytes_per_partition]
600-
596+
@subscribed_topics.each do |topic_or_regex, config|
597+
default_offset = config[:default_offset]
598+
start_from_beginning = config[:start_from_beginning]
599+
max_bytes_per_partition = config[:max_bytes_per_partition]
601600
if topic_or_regex.is_a?(Regexp)
602601
subscribe_to_regex(topic_or_regex, default_offset, start_from_beginning, max_bytes_per_partition)
603602
else

0 commit comments

Comments
 (0)