summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2019-02-15 07:36:48 +0000
committerintrigeri <intrigeri@boum.org>2019-02-15 07:36:48 +0000
commit4f591943ec2ec519d14533d2772cd12b7215c681 (patch)
tree11729a759464704b896595ce749dc65d1702982d
parentd40f7cdec4d75f7c0d0eb0cbd6d1eff7b3f14227 (diff)
Refactoring: simplify.
-rw-r--r--lib/Tails/Persistence/Configuration/ConfigFile.pm8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Tails/Persistence/Configuration/ConfigFile.pm b/lib/Tails/Persistence/Configuration/ConfigFile.pm
index b911b4a..b3c94d9 100644
--- a/lib/Tails/Persistence/Configuration/ConfigFile.pm
+++ b/lib/Tails/Persistence/Configuration/ConfigFile.pm
@@ -95,9 +95,7 @@ Throw exception on error.
=cut
method save () {
my $config_file_was_empty = ! -s $self->config_file_path;
- unless ($config_file_was_empty) {
- $self->backup;
- }
+ $self->backup unless $config_file_was_empty;
$self->config_file_path->spew($self->output);
$self->config_file_path->chmod(0600);
# Ensure our changes land on the disk
@@ -108,9 +106,7 @@ method save () {
# When persistence.conf was initially empty (for example, when
# we're initializing a new persistent volume), let's backup the
# (probably non-empty) version of it that we've just saved.
- if ($config_file_was_empty) {
- $self->backup;
- }
+ $self->backup if $config_file_was_empty;
}
no Moo;