mirror of
https://github.com/chatmail/core.git
synced 2026-05-24 17:26:30 +03:00
move invariant out of loop, less LOC and 1.5% faster
This commit is contained in:
@@ -2270,13 +2270,12 @@ pub async fn get_chat_msgs(
|
|||||||
let mut ret = Vec::new();
|
let mut ret = Vec::new();
|
||||||
let mut last_day = 0;
|
let mut last_day = 0;
|
||||||
let cnv_to_local = dc_gm2local_offset();
|
let cnv_to_local = dc_gm2local_offset();
|
||||||
let markerbefore.unwrap_or_else(MsgId::not_set()
|
let marker1 = marker1before.unwrap_or_else(MsgId::new_unset);
|
||||||
|
|
||||||
for (ts, curr_id) in sorted_rows {
|
for (ts, curr_id) in sorted_rows {
|
||||||
if let Some(marker_id) = marker1before {
|
if curr_id == marker1 {
|
||||||
if curr_id == marker_id {
|
|
||||||
ret.push(ChatItem::Marker1);
|
ret.push(ChatItem::Marker1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (flags & DC_GCM_ADDDAYMARKER) != 0 {
|
if (flags & DC_GCM_ADDDAYMARKER) != 0 {
|
||||||
let curr_local_timestamp = ts + cnv_to_local;
|
let curr_local_timestamp = ts + cnv_to_local;
|
||||||
let curr_day = curr_local_timestamp / 86400;
|
let curr_day = curr_local_timestamp / 86400;
|
||||||
|
|||||||
Reference in New Issue
Block a user