Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 8547029c1b53e71454baa039b1bef1da208e941f Mon Sep 17 00:00:00 2001
- From: Wojciech Meyer <[email protected]>
- Date: Mon, 8 Oct 2012 02:46:49 +0100
- Subject: [PATCH] Remove unsafe hd
- ---
- odb.ml | 4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
- diff --git a/odb.ml b/odb.ml
- index 49e79bf..d2d29d5 100755
- --- a/odb.ml
- +++ b/odb.ml
- @@ -492,7 +492,9 @@ module Dep = struct
- else []) lines |> List.concat
- (* Consider only base packages, filter out the package we are installing to
- handle cases where we have sub packages *)
- - |> List.map (fun p -> Str.split (Str.regexp "\\.") p |> List.hd)
- + |> fun x -> (match List.map (fun p -> Str.split (Str.regexp "\\.") p) x with
- + | hd :: _ -> hd
- + | [] -> [])
- |> List.filter ((<>) p)
- |> List.filter (fun p -> not (Str.string_match weird_rx p 0))
- in
- --
- 1.7.4.1
Advertisement
Add Comment
Please, Sign In to add comment