Skip to content

Commit

Permalink
Add explanatory comment
Browse files Browse the repository at this point in the history
Leo and I were looking over this code and I couldn't remember what it
was doing.  So after I re-derived its purpose, we figured that an
explanatory comment was in order.

(imported from commit ce984362e2b504b40f3d3586777bd73691ad5ea7)
  • Loading branch information
zbenjamin committed Nov 12, 2013
1 parent 673f497 commit 3f0fa36
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions static/js/message_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ MessageList.prototype = {

if (closest === items.length
|| (closest !== 0
// We have the index at which a message with the
// given id would be inserted, but that isn't
// necessarily the index of the message that has an
// id that is closest to the query; it could be the
// previous message in the list.
&& (id - items[closest - 1].id <
items[closest].id - id)))
{
Expand Down

0 comments on commit 3f0fa36

Please sign in to comment.