Skip to content

Commit

Permalink
[TIDYING] Replacing function "set_difference" with the equivalent sta…
Browse files Browse the repository at this point in the history
…ndard library function.

Signed-off-by: Jonathan Knowles <jonathan.knowles@eu.citrix.com>
  • Loading branch information
jonathanknowles committed Mar 23, 2011
1 parent 6c2db17 commit e33f940
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 3 additions & 4 deletions ocaml/xapi/xapi_pif.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ open D

module L = Debug.Debugger (struct let name="license" end)

open Listext
open Stringext

let bridge_naming_convention (device: string) =
Expand Down Expand Up @@ -185,8 +186,6 @@ let find_or_create_network (bridge: string) (device: string) ~__context =
~bridge ~other_config:[] ~blobs:[] ~tags:[] in
net_ref

let set_difference a b = List.filter (fun x -> not(List.mem x b)) a

type tables = {
mac_to_pif_table: (string * API.ref_PIF) list;
mac_to_phy_table: (string * string) list;
Expand Down Expand Up @@ -427,7 +426,7 @@ let scan ~__context ~host =
~t ~__context ~host ~mAC:mac ~mTU ~vLAN:(-1L)
~vLAN_master_of:Ref.null ~device () in
())
(set_difference physical_macs existing_macs);
(List.set_difference physical_macs existing_macs);

(* Make sure the right PIF(s) are marked as management PIFs *)
update_management_flags ~__context ~host
Expand All @@ -448,7 +447,7 @@ let scan_bios ~__context ~host =
introduce_internal
~t ~__context ~host ~mAC:mac ~mTU ~vLAN:(-1L)
~vLAN_master_of:Ref.null ~device:device' ())
(set_difference physical_macs existing_macs) in
(List.set_difference physical_macs existing_macs) in
new_pifs

(* DEPRECATED! Rewritten to use VLAN.create. *)
Expand Down
3 changes: 0 additions & 3 deletions ocaml/xapi/xapi_pif.mli
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ val read_bridges_from_inventory : unit -> string list
val find_or_create_network :
string -> string -> __context:Context.t -> [ `network ] Ref.t

(** Compute the set difference a - b *)
val set_difference : 'a list -> 'a list -> 'a list

(** Convenient lookup tables for scanning etc *)
type tables = {
mac_to_pif_table : (string * API.ref_PIF) list; (** MAC address to PIF reference (all PIFs) *)
Expand Down

0 comments on commit e33f940

Please sign in to comment.