[Libguestfs] [PATCH v3 18/22] v2v: vCenter: Replace Str with PCRE.

Pino Toscano ptoscano at redhat.com
Wed Sep 27 12:39:25 UTC 2017


On Friday, 22 September 2017 09:36:19 CEST Richard W.M. Jones wrote:
> ---
>  v2v/vCenter.ml | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/v2v/vCenter.ml b/v2v/vCenter.ml
> index d5e7c0378..434c93395 100644
> --- a/v2v/vCenter.ml
> +++ b/v2v/vCenter.ml
> @@ -113,7 +113,7 @@ let get_session_cookie password scheme uri sslverify url =
>        Some !session_cookie
>    )
>  
> -let multiple_slash = Str.regexp "/+"
> +let multiple_slash = PCRE.compile "/+"

This can be optimized as "/{2,}", so single slashes will not be
replaced by themselves.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20170927/29dbf06c/attachment.sig>


More information about the Libguestfs mailing list