From f319378a4dcaadd98fb5837074bd0b77625308b4 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Thu, 30 Aug 2018 08:02:16 -0400 Subject: Speed up arg quoting and search for all whitespace --- lib/IRC/Client.pm6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 46832af..dec288f 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -357,7 +357,11 @@ method send-cmd ($cmd, *@args is copy, :$prefix = '', :$server) { } } else { - @args[*-1] = ':' ~ @args[*-1] if @args && @args[*-1] ~~ / ^':' | ' ' | ^$ /; + if @args { + my $last := @args[*-1]; + $last = ':' ~ $last + if not $last or $last.starts-with: ':' or $last.match: /\s/; + } self!ssay: :$server, join ' ', $cmd, @args; } } -- cgit v1.1