]> git.scottworley.com Git - reliable-chat/commitdiff
Keep messages sorted by timestamp
authorScott Worley <sworley@chkno.net>
Fri, 3 Aug 2012 18:30:52 +0000 (11:30 -0700)
committerScott Worley <sworley@chkno.net>
Fri, 3 Aug 2012 18:30:52 +0000 (11:30 -0700)
This causes messages that appear on some servers and not others to be
correctly interleaved on initial load.

Note: this is incomplete. rcupdatemessagetime() can break history's
always-in-sorted-order invariant by changing Time after messages have
been inserted.  Fixing this is next.

Consider replacing rcaddmessagetohistory()'s simple backwards linear scan
with a binary search in the unlikely event that its performance is ever
noticed.


No differences found