[2023][ruby][5.x] remove more duplicate code

main
Alpha Chen 12 months ago
parent 5525e8b7e5
commit 1931b227df
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -81,9 +81,6 @@ p dests.map(&:begin).min
# } # }
# .min # .min
# seeds = seeds
# .each_slice(2)
# .map {|start, length| (start...start+length) }
reversed = mappings reversed = mappings
.map {|mapping| .map {|mapping|
Mapping.new( Mapping.new(
@ -98,9 +95,6 @@ reversed = mappings
# seeds.any? { _1.cover?(source) } # seeds.any? { _1.cover?(source) }
# } # }
# seeds = seeds
# .each_slice(2)
# .map {|start, length| (start...start+length) }
lowest = seeds lowest = seeds
.flat_map(&:minmax) .flat_map(&:minmax)
.filter_map {|seed| .filter_map {|seed|

Loading…
Cancel
Save