Skip to content

Commit 41c9107

Browse files
committed
Improve MessageId hash calculation.
1 parent 4d027c0 commit 41c9107

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

td/telegram/OrderedMessage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace td {
1212

1313
void OrderedMessages::insert(MessageId message_id, bool auto_attach, MessageId old_last_message_id,
1414
const char *source) {
15-
auto random_y = static_cast<int32>(static_cast<uint32>(message_id.get() * 2101234567u));
15+
auto random_y = static_cast<int32>(MessageIdHash()(message_id));
1616
unique_ptr<OrderedMessage> *v = &messages_;
1717
while (*v != nullptr && (*v)->random_y_ >= random_y) {
1818
if ((*v)->message_id_.get() < message_id.get()) {

0 commit comments

Comments
 (0)