Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix #120517, Str:D:.words returns the one elem if it is just one

This way .perl on it looks a bit nicer.
  • Loading branch information...
commit 9dfecb8991faefa488ad4fbd55bd188943e70fea 1 parent b11094e
@FROGGS FROGGS authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  src/core/Str.pm
View
3  src/core/Str.pm
@@ -800,7 +800,8 @@ my class Str does Stringy { # declared in BOOTSTRAP
}
method words(Str:D: $limit = *) {
- self.comb( / \S+ /, $limit );
+ my @chunks := self.comb( / \S+ /, $limit );
+ +@chunks == 1 ?? @chunks[0] !! @chunks
}
my %enc_type = utf8 => utf8, utf16 => utf16, utf32 => utf32;
Please sign in to comment.
Something went wrong with that request. Please try again.