From 1d21df7e7abdb1a5fc07da9879a94d5e8df8945c Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Mon, 18 Jun 2018 10:35:03 -0400 Subject: [PATCH] Use cheaper conditional It's about 30x faster --- lib/HTTP/Request.pm6 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/HTTP/Request.pm6 b/lib/HTTP/Request.pm6 index c402417..8ff5f5f 100644 --- a/lib/HTTP/Request.pm6 +++ b/lib/HTTP/Request.pm6 @@ -282,9 +282,7 @@ method make-boundary(int $size=10) { method Str (:$debug, Bool :$bin) { - if $.file !~~ /^\// { - $.file = '/' ~ $.file; - } + $.file = '/' ~ $.file unless $.file.starts-with: '/'; my $s = "$.method $.file $.protocol"; $s ~= $CRLF ~ callwith($CRLF, :debug($debug), :$bin); }