ripple / rippled-network-crawler

Deprecated: Use https://github.com/xpring-eng/rippled-network-crawler instead.
https://github.com/xpring-eng/rippled-network-crawler
ISC License
17 stars 17 forks source link

src/lib/utility.normalizePubKey can be optimized #44

Closed sourencho closed 4 years ago

sourencho commented 9 years ago

sublimator suggested

function memoize(func) {
  var cache = {};

  return function memoized() {
    var key = arguments.length === 1 &&
              typeof arguments[0] === 'string' ?
                arguments[0] : JSON.stringify(arguments);
    var cached = cache[key];
    return  cached !== undefined? cached :
            cache[key] = func.apply(this, arguments);
  };
}

exports.normalizePubKey = memoize(normalizePubKey)
intelliot commented 4 years ago

As with the other issues in this repo, I'm closing this because it's over 5 years old and this repo has moved. But if anyone cares about this issue, please feel free to open a new one at https://github.com/xpring-eng/rippled-network-crawler/issues and write up the specifics on the work that you think should be done