Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Commit

Permalink
Add a comment for the refacotred is_ok
Browse files Browse the repository at this point in the history
  • Loading branch information
davisp committed Jan 28, 2012
1 parent f25a7d7 commit c58c617
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mem3_sync_security.erl
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,20 @@ get_all_security(DbName) ->
end.

is_ok([_]) ->
% One security object is the happy case
ok;
is_ok([_, _] = SecObjs0) ->
% This is the strict heuristic where there is one version of
% the security object that out numbers empty security objects.
% If so, just overwrite the empty objects with the non-empty
% version.
case lists:keytake({[]}, 1, SecObjs0) of
{value, {_, EmptyCount}, [{SecObj, Count}]} when Count > EmptyCount ->
{fixable, SecObj};
_ ->
broken
end;
is_ok(_) ->
% Anything else requires human intervention
broken.

0 comments on commit c58c617

Please sign in to comment.