projects
/
scpubgit/stemmatology.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
96ba041
)
some syntactic sugar for relationship filters
Tara L Andrews [Wed, 11 Jul 2012 10:08:37 +0000 (12:08 +0200)]
lib/Text/Tradition/Collation/RelationshipStore.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Text/Tradition/Collation/RelationshipStore.pm
b/lib/Text/Tradition/Collation/RelationshipStore.pm
index
aeb8b7f
..
0ee51ab
100644
(file)
--- a/
lib/Text/Tradition/Collation/RelationshipStore.pm
+++ b/
lib/Text/Tradition/Collation/RelationshipStore.pm
@@
-717,6
+717,9
@@
sub related_readings {
# Backwards compat
if( $filter eq 'colocated' ) {
$filter = sub { $_[0]->colocated };
+ } elsif( !ref( $filter ) ) {
+ my $type = $filter;
+ $filter = sub { $_[0]->type eq $type };
}
my %found = ( $reading => 1 );
my $check = [ $reading ];