From bd098e40e87f5c27813853815d918b59318a95cd Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Thu, 30 Oct 2014 16:19:39 +0100 Subject: Benchmark of ht --- test/src/db.erl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/src/db.erl (limited to 'test') diff --git a/test/src/db.erl b/test/src/db.erl new file mode 100644 index 0000000..8c90842 --- /dev/null +++ b/test/src/db.erl @@ -0,0 +1,18 @@ +%%% Copyright (c) 2014, NORDUnet A/S. +%%% See LICENSE for licensing information. + +-module(db). +-export([get_by_indices/3]). + +get_by_indices(Start, _End, _Options) when Start < 0 -> + []; +get_by_indices(Start, End, _Options) -> + case Start =< End of + true -> + B = crypto:hash(sha256, <<"bar">>), + lists:map(fun (Index) -> + {Index, B, notfetched} + end, lists:seq(Start, End)); + false -> + [] + end. -- cgit v1.1