[rt-devel] Keyword brainfart

Jesse jesse at fsck.com
Mon Apr 2 12:51:14 EDT 2001


Ah. I see now that that's not outside the last loop and will
decrement the method variable too much....



On Mon, Apr 02, 2001 at 09:32:06AM -0700, ivan wrote:
> Here's an example of why it's a bad idea to fiddle code gratuitously.
> This should be obvious; let me know if you need further explanation.
> 
> Index: Keyword.pm
> ===================================================================
> RCS file: /proj/maps/cvsroot/rt/lib/RT/Keyword.pm,v
> retrieving revision 1.1.2.3
> retrieving revision 1.12
> diff -u -b -r1.1.2.3 -r1.12
> --- Keyword.pm  2001/04/02 16:25:11     1.1.2.3
> +++ Keyword.pm  2001/03/20 09:13:39     1.12
> @@ -311,10 +310,7 @@
>         $results{ $Keyword->id } = $Keyword->Name;
>                 
>         if ( $generations == 0 || $generations > 1 ) {
> -           #if we're limiting to some number of generations,
> -           # decrement the number of generations
> -           $generations-- if ( $generations > 1 );
> -           my $kids = $Keyword->Descendents($generations, \%results);
> +           my $kids = $Keyword->Descendents($generations-1, \%results);
>             
>             foreach my $kid ( keys %{$kids}) {
>                 $results{"$kid"} = $Keyword->Name. "/". $kids->{"$kid"};
> 
> 
> 
> 
> -- 
> meow
> _ivan
> 
> _______________________________________________
> Rt-devel mailing list
> Rt-devel at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-devel
> 

-- 
jesse reed vincent -- root at eruditorum.org -- jesse at fsck.com 
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

Any e-mail sent to the SLA will immediately become the intellectual property
of the SLA and the author of said message will enter into a period of
indentured servitude which will last for a period of time no less than seven
years. 




More information about the Rt-devel mailing list