Simplify initCache()

This commit is contained in:
Laurent Monin 2015-06-05 17:15:04 +02:00
parent 14179dda3f
commit 5f08654b16

View file

@ -45,11 +45,7 @@ var MBLinks = function (cachekey, expiration) {
this.initCache = function () {
if (!this.supports_local_storage) return;
// Check if we already added links for this content
var cache_string = localStorage.getItem(this.cache_key);
if (!cache_string) {
cache_string = "{}";
}
this.cache = JSON.parse(cache_string);
this.cache = JSON.parse(localStorage.getItem(this.cache_key) || '{}');
};
this.saveCache = function () {