Skip to content

Commit

Permalink
rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Jun 24, 2024
1 parent af7367b commit 10ca823
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/packer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ def self.pack_big_int(sign, num)
first = "1#{sign}#{num_bits[-6..]}"

num_bits = num_bits[0..-7]
bytes = []
num_bits.chars.groups_of(7).each do |seven_bits|
bytes = num_bits.chars.groups_of(7).map do |seven_bits|
# mark all as extended
bytes << "1#{seven_bits.join.rjust(7, '0')}"
"1#{seven_bits.join.rjust(7, '0')}"
end
# least significant first
bytes = bytes.reverse
Expand Down
3 changes: 2 additions & 1 deletion lib/teeworlds_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,8 @@ def process_server_packet(packet)
# in sequence
@netbase.ack = (@netbase.ack + 1) % NET_MAX_SEQUENCE
else
puts "warning: got chunk out of sequence! seq=#{chunk.seq} expected_seq=#{(@netbase.ack + 1) % NET_MAX_SEQUENCE}"
puts 'warning: got chunk out of sequence! ' \
"seq=#{chunk.seq} expected_seq=#{(@netbase.ack + 1) % NET_MAX_SEQUENCE}"
if seq_in_backroom?(chunk.seq, @netbase.ack)
puts ' dropping known chunk ...'
next
Expand Down

0 comments on commit 10ca823

Please sign in to comment.