Explorar o código

minor : don't generate empty <meta/>

Nicolas Cannasse %!s(int64=13) %!d(string=hai) anos
pai
achega
22fee12f31
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      genxml.ml

+ 3 - 2
genxml.ml

@@ -87,10 +87,11 @@ let rec sexpr (e,_) =
 	| EObjectDecl fl -> "{" ^ (String.concat "," (List.map (fun (n,e) -> n ^ ":" ^ (sexpr e)) fl)) ^ "}"
 	| _ -> "'???'"
 
-let gen_meta meta = match meta with
+let gen_meta meta = 
+	let meta = List.filter (fun (m,_,_) -> match m with ":?used" | ":realPath" -> false | _ -> true) meta in 
+	match meta with
 	| [] -> []
 	| _ ->
-		let meta = List.filter (fun (m,_,_) -> match m with ":?used" | ":realPath" -> false | _ -> true) meta in
 		let nodes = List.map (fun (m,el,_) ->
 			node "m" ["n",m] (List.map (fun e -> node "e" [] [gen_string (sexpr e)]) el)
 		) meta in