From: Scott Worley Date: Fri, 3 Aug 2012 18:30:52 +0000 (-0700) Subject: Keep messages sorted by timestamp X-Git-Url: http://git.scottworley.com/reliable-chat/commitdiff_plain/7f54ca0afcd01093cafcee969b6272ec5c05f542?ds=sidebyside;hp=7f54ca0afcd01093cafcee969b6272ec5c05f542 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. ---