]> git.scottworley.com Git - reliable-chat/commit - webclient/rc.html
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)
commit7f54ca0afcd01093cafcee969b6272ec5c05f542
tree4b5f11c88e987bfbe2e2e326b4b6b824b91e3939
parent16640c5d843dd7fd5edbd5c98ef6035ffa96eea4
Keep messages sorted by timestamp

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.
webclient/rc.html