-
-
Save AlexDaniel/719b855bc2f76ce1a8d2bbd14d0862a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Data/StaticTable.pm6 b/lib/Data/StaticTable.pm6 | |
index df6cdc0..d175dcb 100644 | |
--- a/lib/Data/StaticTable.pm6 | |
+++ b/lib/Data/StaticTable.pm6 | |
@@ -317,12 +317,12 @@ class StaticTable::Query { | |
X::Data::StaticTable.new("Method grep only accepts one adverb at a time").throw unless one($n, $r, $default, $nr, $nh) == True; | |
my Data::StaticTable::Position @rownums; | |
if (%!indexes{$heading}:exists) { #-- Search in the index if it is available. Should be faster. | |
- my @keysearch = grep {.defined and $matcher}, %!indexes{$heading}.keys; | |
+ my @keysearch = grep {.defined and $_ ~~ $matcher}, %!indexes{$heading}.keys; | |
for (@keysearch) -> $k { | |
@rownums.push(|%!indexes{$heading}{$k}); | |
} | |
} else {; | |
- @rownums = 1 <<+>> ( grep {.defined and $matcher}, :k, $!T.column($heading) ); | |
+ @rownums = 1 <<+>> ( grep {.defined and $_ ~~ $matcher}, :k, $!T.column($heading) ); | |
} | |
if ($n) { # Returning rowlist | |
return @rownums.sort.list #-- :n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment