summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-11-02 11:58:57 +0000
committerMatthew Sackman <matthew@rabbitmq.com>2010-11-02 11:58:57 +0000
commit48d98eff14ac2d1e80cadb624bfd55ac21c795b4 (patch)
tree577457d2442cc06cdb2091602626fb0d0f9eab40
parent4d06fff49065c838c7a318909f1a39c65dde4740 (diff)
downloadrabbitmq-server-48d98eff14ac2d1e80cadb624bfd55ac21c795b4.tar.gz
Same as before - avoid unnecessary functions for pattern match
-rw-r--r--src/rabbit_upgrade.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_upgrade.erl b/src/rabbit_upgrade.erl
index c029a5ec..066fe23b 100644
--- a/src/rabbit_upgrade.erl
+++ b/src/rabbit_upgrade.erl
@@ -49,9 +49,9 @@ maybe_upgrade(Dir) ->
case unknown_heads(CurrentHeads, G) of
[] ->
Upgrades = upgrades_to_apply(CurrentHeads, G),
- case length(Upgrades) of
- 0 -> ok;
- _ -> apply_upgrades(Upgrades, Dir)
+ case Upgrades of
+ [] -> ok;
+ _ -> apply_upgrades(Upgrades, Dir)
end;
Unknown ->
[warn("Data store has had future upgrade ~w applied." ++
@@ -117,7 +117,7 @@ apply_upgrades(Upgrades, Dir) ->
ok = file:close(Lock),
[apply_upgrade(Upgrade) || Upgrade <- Upgrades],
info("Upgrades: All applied~n", []),
- write_version(Dir),
+ ok = write_version(Dir),
ok = file:delete(LockFile);
{ok, _FI} ->
exit(previous_upgrade_failed);