From d4985ef5f4b0af1d9ae16895ef3a69adc62802c1 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 20 Sep 2012 13:44:31 -0400 Subject: [PATCH] Optimize select_zephyr_by_id for the already-selected case Saves a call to get_zephyr. (imported from commit 9ce9f2af7e4d8eb5e3a76a3c0ddbfb7f5896a583) --- zephyr/static/js/zephyr.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index 38d3247ec4..40b8fd3ecf 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -306,6 +306,9 @@ function respond_to_zephyr() { } function select_zephyr_by_id(zephyr_id, scroll_to) { + if (zephyr_id === selected_zephyr_id) { + return; + } select_zephyr(get_zephyr(zephyr_id), scroll_to); }