Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Add a comment for the refacotred is_ok
  • Loading branch information
davisp committed Jan 28, 2012
1 parent f25a7d7 commit c58c61777942252f64884983a798f40bbbd0fa93
Showing 1 changed file with 6 additions and 0 deletions.
@@ -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.