From 3f0fa363f9cf18321e5d3e043dfba61a1ebcdee4 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Tue, 12 Nov 2013 14:35:10 -0500 Subject: [PATCH] Add explanatory comment 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) --- static/js/message_list.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/js/message_list.js b/static/js/message_list.js index bb9d2c4d64..981ae5463b 100644 --- a/static/js/message_list.js +++ b/static/js/message_list.js @@ -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))) {