From b618ffb7159b69c91ff56d2dde33d7bf738560cd Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 7 May 2018 12:07:50 +0800 Subject: [PATCH] Remove file that is no longer used. --- .../discourse/lib/binary-search.js.es6 | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 app/assets/javascripts/discourse/lib/binary-search.js.es6 diff --git a/app/assets/javascripts/discourse/lib/binary-search.js.es6 b/app/assets/javascripts/discourse/lib/binary-search.js.es6 deleted file mode 100644 index 03675866e0a..00000000000 --- a/app/assets/javascripts/discourse/lib/binary-search.js.es6 +++ /dev/null @@ -1,29 +0,0 @@ -// The binarySearch() function is licensed under the UNLICENSE -// https://github.com/Olical/binary-search - -// Modified for use in Discourse - -export default function binarySearch(list, target, keyProp) { - var min = 0; - var max = list.length - 1; - var guess; - var keyProperty = keyProp || "id"; - - while (min <= max) { - guess = Math.floor((min + max) / 2); - - if (Em.get(list[guess], keyProperty) === target) { - return guess; - } - else { - if (Em.get(list[guess], keyProperty) < target) { - min = guess + 1; - } - else { - max = guess - 1; - } - } - } - - return -Math.floor((min + max) / 2); -}