Re: [Libguestfs] [PATCH v2 4/4] common/mltools: xpath_helpers: Get rid of xpath_*_default functions.

Pino Toscano
Thu, 12 Oct 2017 13:52:57 -0000

On Sunday, 8 October 2017 23:26:56 CEST Richard W.M. Jones
wrote:
> Instead of using ‘xpath_(string|int|int64)_default’ we can write the
> equivalent code using ‘Option.default’.  This is not quite so concise,
> but may be easier to understand.
>
> eg:
>   xpath_int_default xctx "xpath_expr" 10
> ->
>   Option.default 10 (xpath_int xctx "xpath_expr")
> ---

LGTM.

Thanks,
--
Pino Toscano