diff options
author | Zoffix Znet <zoffixznet@users.noreply.github.com> | 2018-08-30 08:02:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-30 08:02:16 -0400 |
commit | f319378a4dcaadd98fb5837074bd0b77625308b4 (patch) | |
tree | e610320090aa2eeb02425b10f1a23fa78a6dce6c /lib/IRC | |
parent | ee85c330349621320c97acd53bc9c42d7ceaad45 (diff) |
Speed up arg quoting and search for all whitespace
Diffstat (limited to 'lib/IRC')
-rw-r--r-- | lib/IRC/Client.pm6 | 6 |
1 files changed, 5 insertions, 1 deletions
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; } } |