summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2018-08-28 16:27:28 +0200
committerPatrick Spek <p.spek@tyil.nl>2018-08-28 16:27:28 +0200
commit4bf9ea44cf89aa485790985b30f7ded8adaefc33 (patch)
tree4160cce439d61ec049c28fd5e42eede21f8bffd3 /lib
parent03f58fc9e875b6c5c33e73096bacd4b72d084e6c (diff)
Use .words for performance reasons
Diffstat (limited to 'lib')
-rw-r--r--lib/String/Fold.pm62
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/String/Fold.pm6 b/lib/String/Fold.pm6
index 2db1155..9043b94 100644
--- a/lib/String/Fold.pm6
+++ b/lib/String/Fold.pm6
@@ -28,7 +28,7 @@ sub fold (
}
# Work through each word on the line and fold them to the maximum width.
- for $line.comb(/\S+/) -> $word {
+ for $line.words -> $word {
if (new-line-length(@current-words, $word, $indent) <= $width) {
@current-words.append($word);
next;