summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/lodash/_setData.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/lodash/_setData.js')
-rw-r--r--tools/eslint/node_modules/lodash/_setData.js26
1 files changed, 2 insertions, 24 deletions
diff --git a/tools/eslint/node_modules/lodash/_setData.js b/tools/eslint/node_modules/lodash/_setData.js
index d86c61086e..e5cf3eb96a 100644
--- a/tools/eslint/node_modules/lodash/_setData.js
+++ b/tools/eslint/node_modules/lodash/_setData.js
@@ -1,9 +1,5 @@
var baseSetData = require('./_baseSetData'),
- now = require('./now');
-
-/** Used to detect hot functions by number of calls within a span of milliseconds. */
-var HOT_COUNT = 150,
- HOT_SPAN = 16;
+ shortOut = require('./_shortOut');
/**
* Sets metadata for `func`.
@@ -19,24 +15,6 @@ var HOT_COUNT = 150,
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
-var setData = (function() {
- var count = 0,
- lastCalled = 0;
-
- return function(key, value) {
- var stamp = now(),
- remaining = HOT_SPAN - (stamp - lastCalled);
-
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return key;
- }
- } else {
- count = 0;
- }
- return baseSetData(key, value);
- };
-}());
+var setData = shortOut(baseSetData);
module.exports = setData;