Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/conway.cr
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct ConwayMap
def initialize(pattern)
@map = Array.new(HEIGHT) { Array.new(WIDTH, false) }

ix = min WIDTH, pattern.map(&.size).max
ix = min WIDTH, pattern.max_of(&.size)
iy = min HEIGHT, pattern.size
dx = (WIDTH - ix) // 2
dy = (HEIGHT - iy) // 2
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/codegen/primitives.cr
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class Crystal::CodeGenVisitor
end

calc_signed = t1.signed? || t2.signed?
calc_width = {t1, t2}.map { |t| t.bytes * 8 + ((calc_signed && t.unsigned?) ? 1 : 0) }.max
calc_width = {t1, t2}.max_of { |t| t.bytes * 8 + ((calc_signed && t.unsigned?) ? 1 : 0) }
calc_type = llvm_context.int(calc_width)

e1 = t1.signed? ? builder.sext(p1, calc_type) : builder.zext(p1, calc_type)
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/tools/init.cr
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ module Crystal
def overwrite_checks(views)
existing_views, new_views = views.partition(&.overwriting?)

if existing_views.any? && !config.skip_existing
if existing_views.present? && !config.skip_existing
raise FilesConflictError.new existing_views.map(&.path)
end

Expand Down