We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef94ee6 commit 62185c8Copy full SHA for 62185c8
src/mod_private_mnesia.erl
@@ -111,23 +111,19 @@ del_data(LUser, LServer, NS) ->
111
112
-spec get_users_with_data(binary(), binary()) -> {ok, [binary()]} | {error, any()}.
113
get_users_with_data(LServer, NS) ->
114
- case mnesia:dirty_select(private_storage,
+ Val = mnesia:dirty_select(private_storage,
115
[{#private_storage{usns =
116
{'$1',
117
LServer,
118
NS},
119
_ = '_'},
120
- [], ['$1']}]) of
121
- Val when is_list(Val) -> {ok, Val};
122
- _ -> {error, db_failure}
123
- end.
+ [], ['$1']}]),
+ {ok, Val}.
124
125
-spec count_users_with_data(binary(), binary()) -> {ok, integer()} | {error, any()}.
126
count_users_with_data(LServer, NS) ->
127
- case get_users_with_data(LServer, NS) of
128
- {ok, Val} -> {ok, length(Val)};
129
- Err -> Err
130
+ {ok, Val} = get_users_with_data(LServer, NS),
+ {ok, length(Val)}.
131
132
import(LServer, <<"private_storage">>,
133
[LUser, XMLNS, XML, _TimeStamp]) ->
0 commit comments