Skip to content

Commit

Permalink
Fix from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Oct 20, 2023
1 parent 10703fd commit dbfbca9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/y2storage/proposal/devices_planner.rb
Expand Up @@ -93,7 +93,7 @@ def planned_boot_devices(planned_devices)
# @param required_size [DiskSize]
# @return [Partition]
def reusable_swap(required_size)
return nil if skip_swap_reuse?
return nil unless try_to_reuse_swap?

partitions = available_swap_partitions
partitions.select! { |part| can_be_reused?(part, required_size) }
Expand All @@ -108,11 +108,11 @@ def available_swap_partitions
devicegraph.partitions.select(&:swap?)
end

# Whether reusing swap partitions is pointless
# Whether it makes sense to try to reuse existing swap partitions
#
# @return [Boolean]
def skip_swap_reuse?
settings.use_lvm || settings.use_encryption || settings.swap_reuse == :none
def try_to_reuse_swap?
!settings.use_lvm && !settings.use_encryption && settings.swap_reuse != :none
end

# Whether it is acceptable to reuse the given swap partition
Expand Down

0 comments on commit dbfbca9

Please sign in to comment.