don't sort unless you're going to safe a group and then only sort that group

This commit is contained in:
Ward Wouts 2002-05-05 22:18:44 +00:00
parent 53879858b2
commit 5590a47f21

View file

@ -125,7 +125,7 @@ def get_articles(cachedir=false)
# end
# end
end
subject_sort unless @sorted # store cache sorted
# subject_sort unless @sorted # store cache sorted
save_cache(cachedir)
end
@ -178,7 +178,9 @@ def get_group_body_rest(subj, file=nil)
print "Server: #{@groups[subj]["servers"][i]}\n"
print "Messid: #{@groups[subj]["messages"][i]}\n"
resp, id, messid, list = @connections[@groups[subj]["servers"][i]]["nntp"].body(@groups[subj]["messages"][i])
if resp == false
return false
end
rescue Net::NNTPReplyError
print "Caught Net::NNTPReplyError reading article #{@groups[subj]["messages"][0]}\n"
return false
@ -238,7 +240,7 @@ end
def group_subjects
@groups = {}
subject_sort unless @sorted
#subject_sort unless @sorted
prev_subj = ""
for i in (0...@subjects.length)
print "group subjects: #{i} #{@subjects[i]}\n" if Debuglevel > 1
@ -302,7 +304,7 @@ def read_cache(cachedir)
if FileTest.directory?( cachedir) and FileTest.file?( filename ) and FileTest.readable?( filename )
file = File.new( filename )
lines = file.readlines
for line in lines
lines.collect{|line|
#print "line: #{line}\n"
if line =~ /^(.*?)\|(\d+)\|(.*?)\|(.*)$/
#print "messid: #{$1}\n"
@ -312,15 +314,15 @@ def read_cache(cachedir)
#print "First: #{@connections[$3]["first"].to_i}\n";
#print "Last: #{@connections[$3]["last"].to_i}\n";
if @connections.has_key?($3)
unless excludes.has_key?($3) and excludes[$3].has_key?($2.to_i) or
$2.to_i < @connections[$3]["first"].to_i or
$2.to_i > @connections[$3]["last"].to_i
add($1, $2, $3, $4)
@connections[$3]["skip_ids"].insert($2.to_i)
end
unless excludes.has_key?($3) and excludes[$3].has_key?($2.to_i) or
$2.to_i < @connections[$3]["first"].to_i or
$2.to_i > @connections[$3]["last"].to_i
add($1, $2, $3, $4)
@connections[$3]["skip_ids"].insert($2.to_i)
end
end
end
end
}
end
end