aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2020-05-14 09:46:42 +0300
committerGitHub <[email protected]>2020-05-14 09:46:42 +0300
commit7966167cf6d52ce1841b9f1d2d37700ec7d2b3c4 (patch)
treebeef0ea04f20b97a7b66bf127652c8884fd8e0f5 /js
parentddf39a509213d697857e112d1a7f7a3fc8830d65 (diff)
downloadbootstrap-7966167cf6d52ce1841b9f1d2d37700ec7d2b3c4.tar.xz
bootstrap-7966167cf6d52ce1841b9f1d2d37700ec7d2b3c4.zip
Replace double tilde with `Math.floor` (#30691)
Nowadays, browser engines have improved a lot and `Math.floor` is the same, if not faster. Also, clarity is better than micro-optimizations in this case.
Diffstat (limited to 'js')
-rw-r--r--js/src/util/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/src/util/index.js b/js/src/util/index.js
index cee403481..f92c7eb5d 100644
--- a/js/src/util/index.js
+++ b/js/src/util/index.js
@@ -26,7 +26,7 @@ const toType = obj => {
const getUID = prefix => {
do {
- prefix += ~~(Math.random() * MAX_UID) // "~~" acts like a faster Math.floor() here
+ prefix += Math.floor(Math.random() * MAX_UID)
} while (document.getElementById(prefix))
return prefix