diff options
| author | fukachan <fukachan> | 2001-11-10 08:50:41 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-11-10 08:50:41 +0000 |
| commit | 4d9b6032da532bce9f0f27ee504fa2ff05eceb39 (patch) | |
| tree | 626c66f40a0a59b0b5b31f6ddb7adef044d96374 /fml/lib/Mail/ThreadTrack | |
| parent | e120a0de64536d1258cbd71fbcda3d5b99abfd6f (diff) | |
| download | fml8-4d9b6032da532bce9f0f27ee504fa2ff05eceb39.tar.gz fml8-4d9b6032da532bce9f0f27ee504fa2ff05eceb39.tar.bz2 fml8-4d9b6032da532bce9f0f27ee504fa2ff05eceb39.zip | |
change cost evaluation logic (numeric now)
Diffstat (limited to 'fml/lib/Mail/ThreadTrack')
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Print/Sort.pm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fml/lib/Mail/ThreadTrack/Print/Sort.pm b/fml/lib/Mail/ThreadTrack/Print/Sort.pm index a6ab1429..b2b22e3e 100644 --- a/fml/lib/Mail/ThreadTrack/Print/Sort.pm +++ b/fml/lib/Mail/ThreadTrack/Print/Sort.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Sort.pm,v 1.2 2001/11/09 12:08:46 fukachan Exp $ +# $FML: Sort.pm,v 1.3 2001/11/09 15:09:03 fukachan Exp $ # package Mail::ThreadTrack::Print::Sort; @@ -32,15 +32,19 @@ sub sort_thread_id $self->{ _cost } = $cost; @$thread_id_list = sort { - (defined($cost->{$b}) ? $cost->{$b} : '') - cmp - (defined($cost->{$a}) ? $cost->{$a} : '') + $cost->{$b} <=> $cost->{$a} } @$thread_id_list; return $thread_id_list; } +my $status_cost = { + open => ( 1 << 10 ), + analyzed => ( 1 << 9 ), +}; + + # Descriptions: # Arguments: $self $args # Side Effects: @@ -67,7 +71,8 @@ sub _calculate_age $age{ $tid } = $age; # evaluate cost hash table which is { $thread_id => $cost } - $cost{ $tid } = $rh->{ _status }->{ $tid }.'-'. $age; + my $status = $rh->{ _status }->{ $tid }; + $cost{ $tid } = $status_cost->{ $status } + $age; } return (\%age, \%cost); |
