Skip to content

Commit 0dcb85a

Browse files
committed
rubocop -A
1 parent f981956 commit 0dcb85a

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

examples/08_gui_snapshot.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def draw
6868
own_tee = @tees[@client.local_client_id]
6969
own_tee = @tees.first.last if own_tee.nil?
7070
offset = center_around_tee(own_tee)
71-
@tees.each do |_id, tee|
71+
@tees.each_value do |tee|
7272
@tee_image.draw(tee.x + offset.x, tee.y + offset.y)
7373
end
7474
end

lib/array.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def groups_of(max_size)
2222
group = []
2323
end
2424
end
25-
groups.push(group) unless group.size.zero?
25+
groups.push(group) unless group.empty?
2626
groups
2727
end
2828
end

lib/context.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def initialize(message, keys = {})
1212
end
1313

1414
def verify
15-
@data.each do |key, _value|
15+
@data.each_key do |key|
1616
next if @old_data.key? key
1717

1818
raise "Error: invalid data key '#{key}'\n valid keys: #{@old_data.keys}"

lib/game_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def on_shutdown
149149
return if call_hook(:shutdown, Context.new(nil)).nil?
150150

151151
puts '[gameserver] disconnecting all clients ...'
152-
@server.clients.each do |_id, client|
152+
@server.clients.each_value do |client|
153153
@server.send_ctrl_close(client, @server.shutdown_reason)
154154
end
155155
puts '[gameserver] shutting down ...'

lib/snapshot/items/tune_params.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def initialize(hash_or_raw)
2525
end
2626

2727
def validate
28-
@fields.select(&:nil?).empty?
28+
@fields.none?(&:nil?)
2929
end
3030

3131
def init_unpacker(u)

lib/snapshot/snap_item_base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def initialize(hash_or_raw)
2222
end
2323

2424
def validate
25-
@fields.select(&:nil?).empty?
25+
@fields.none?(&:nil?)
2626
end
2727

2828
def init_unpacker(u)

lib/teeworlds_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def process_chunk(chunk)
438438

439439
def process_server_packet(packet)
440440
data = packet.payload
441-
if data.size.zero?
441+
if data.empty?
442442
puts 'Error: packet payload is empty'
443443
puts packet
444444
return

lib/teeworlds_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def do_snapshot
380380
# msg_snap_single = NetChunk.create_header(vital: false, size: data.size + 1) +
381381
# [pack_msg_id(NETMSG_SNAPSINGLE, system: true)] +
382382
# data
383-
@clients.each do |_id, client|
383+
@clients.each_value do |client|
384384
next unless client.in_game?
385385

386386
@netbase.send_packet(msg_snap_empty, chunks: 1, client:)

0 commit comments

Comments
 (0)