Skip to content
Snippets Groups Projects
Commit 73225f60 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix bug that caused really-long sub-board load times.

I'm not sure how long this has been like this, but the last_msg
of a sub-board can be a super high number (e.g. in the billions), so using
that value as the highest message offset would cause tons of message index
read failures and just cause this loop to interate unneccessarily through
tons of non-existent messages. Also, this code is utter crap.
parent 62882a72
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -52,7 +52,8 @@ function get_message_offsets(type)
// var hdr;
// for(last_offset=0; (idx=msgbase.get_msg_index(true,last_offset)) != null;last_offset++) {
for (var last_offset = 0; last_offset <= msgbase.last_msg; last_offset++) {
var total_msgs = msgbase.total_msgs;
for (var last_offset = 0; last_offset < msgbase.total_msgs; last_offset++) {
var idx = msgbase.get_msg_index(true, last_offset);
if (typeof idx === 'undefined' || idx === null) continue;
if(idx.attr&MSG_DELETE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment