[PATCH] builder: small code simplification
No actual behaviour changes, just remove extra match statements. --- builder/list_entries.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 742e43b..0d3d9b2 100644 --- a/builder/list_entries.ml +++ b/builder/list_entries.ml @@ -98,13 +98,11 @@ and list_entries_json ~sources index = | c -> String.make 1 c) done; !res in - let json_optional_printf_string key value = - match value with + let json_optional_printf_string key = function | None -> () | Some str -> printf " \"%s\": \"%s\",\n" key (json_string_escape str) in - let json_optional_printf_int64 key value = - match value with + let json_optional_printf_int64 key = function | None -> () | Some n -> printf " \"%s\": \"%Ld\",\n" key n in -- 1.8.3.1
On Wed, Jan 22, 2014 at 11:22:48PM +0100, Pino Toscano wrote:
No actual behaviour changes, just remove extra match statements. --- builder/list_entries.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 742e43b..0d3d9b2 100644 --- a/builder/list_entries.ml +++ b/builder/list_entries.ml @@ -98,13 +98,11 @@ and list_entries_json ~sources index = | c -> String.make 1 c) done; !res in - let json_optional_printf_string key value = - match value with + let json_optional_printf_string key = function | None -> () | Some str -> printf " \"%s\": \"%s\",\n" key (json_string_escape str) in - let json_optional_printf_int64 key value = - match value with + let json_optional_printf_int64 key = function | None -> () | Some n -> printf " \"%s\": \"%Ld\",\n" key n in -- 1.8.3.1
ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
participants (2)
-
Pino Toscano -
Richard W.M. Jones