diff options
| author | Linus Nordberg <linus@nordu.net> | 2014-05-03 09:40:57 +0200 |
|---|---|---|
| committer | Linus Nordberg <linus@nordu.net> | 2014-05-03 09:40:57 +0200 |
| commit | 1347f05db5f96314da22ffbd56887b254ecae034 (patch) | |
| tree | 7db83ece24633c45e7c4b57f92358ee92316fdcb /src | |
| parent | df6fca69a7d9bb11d7c6116a9cc4062a6e5e040d (diff) | |
Use mnesia:index_read() instead of select() bc simpler.
Diffstat (limited to 'src')
| -rw-r--r-- | src/db.erl | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -100,8 +100,7 @@ handle_call({dump, Table}, _From, State) -> {reply, Res, State}; handle_call({find, Hash}, _From, State) -> F = fun() -> - mnesia:select(plop, - [{#plop{hash = Hash, _='_'}, [], ['$_']}]) + mnesia:index_read(plop, Hash, #plop.hash) end, {atomic, Result} = mnesia:transaction(F), Record = case length(Result) of |
