Dec 17, 2001 TRIZ Slide 12


More prior action

Speedup: Do it in advance.

To speed the comparison of sections, prebuild a list of possible equivalence region starts:

1 for (my $i = 0; $i < @tokens - ($minmatchlen - 1); $i ++) {
2 
3   my $tjoin = join '|', map {$_->{type}} @tokens [$i..$minmatchlen + $i-1];
4   my $match = {
5 	       start => $i,
6 	       line => $tokens [$i]->{line},
7 	      };
8   push @{$matches {$tjoin}}, $match;
9 }

Ignore all items in %matches with only 1 element.


Next Copyright © 2001, David Turner