Displaying 2 results from an estimated 2 matches for "find_elem".
2014 Jan 21
3
[PATCH] builder: proper consider subkeys in index files
...);
- Hashtbl.add fseen field true
+ Hashtbl.add fseen hashkey true
) fields
) sections;
@@ -162,25 +163,32 @@ let get_index ~prog ~debug ~downloader ~sigchecker source =
let entries =
List.map (
fun (n, fields) ->
+ let find_elem key subkey fields =
+ match List.filter (
+ fun (iterkey, itersubkey, itervalue) ->
+ iterkey = key && itersubkey = subkey
+ ) fields with
+ | [] -> raise Not_found
+ | (_, _, value) :: _ -> value in...
2014 Jan 21
2
Re: [PATCH] builder: proper consider subkeys in index files
...ring (* key + subkey + value *)
Indeed, they work that way. It seemed not totally clear for the
documentations I've read.
> > let entries =
> >
> > List.map (
> >
> > fun (n, fields) ->
> >
> > + let find_elem key subkey fields =
> > + match List.filter (
> > + fun (iterkey, itersubkey, itervalue) ->
> > + iterkey = key && itersubkey = subkey
> > + ) fields with
> > + | [] -> raise Not_found
>...