Skip to content

Commit 6f0c665

Browse files
committed
remove redundant check
1 parent dba6f84 commit 6f0c665

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

jstorage.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
_pubsub_observers = {},
8080

8181
/* skip published items older than current timestamp */
82-
_pubsub_last = +new Date(),
82+
_pubsub_last = +new Date(),
8383

8484
/* Next check for TTL */
8585
_ttl_timeout,
@@ -256,7 +256,7 @@
256256
function _createPolyfillStorage(type, forceCreate){
257257
var _skipSave = false,
258258
_length = 0,
259-
i,
259+
i,
260260
storage,
261261
storage_source = {};
262262

@@ -272,7 +272,7 @@
272272
return;
273273
}
274274

275-
// only IE6/7 from this point on
275+
// only IE6/7 from this point on
276276
if(_backend != "userDataBehavior"){
277277
return;
278278
}
@@ -300,7 +300,7 @@
300300
storage[i] = storage_source[i];
301301
}
302302
}
303-
303+
304304
// Polyfill API
305305

306306
/**
@@ -310,7 +310,7 @@
310310

311311
/**
312312
* Returns the key of the nth stored value
313-
*
313+
*
314314
* @param {Number} n Index position
315315
* @return {String} Key name of the nth stored value
316316
*/
@@ -345,7 +345,7 @@
345345
* Sets or updates value for a give key
346346
*
347347
* @param {String} key Key name to be updated
348-
* @param {String} value String value to be stored
348+
* @param {String} value String value to be stored
349349
*/
350350
storage.setItem = function(key, value){
351351
if(typeof value == "undefined"){
@@ -365,7 +365,7 @@
365365
}
366366

367367
storage[key] = undefined;
368-
368+
369369
_skipSave = true;
370370
if(key in storage){
371371
storage.removeAttribute(key);
@@ -783,7 +783,7 @@
783783
if(!_storage.__jstorage_meta.PubSub){
784784
_storage.__jstorage_meta.PubSub = [];
785785
}
786-
786+
787787
_storage.__jstorage_meta.PubSub.unshift([+new Date, channel, payload]);
788788

789789
_save();
@@ -795,12 +795,12 @@
795795
* JS Implementation of MurmurHash2
796796
*
797797
* SOURCE: https://github.com/garycourt/murmurhash-js (MIT licensed)
798-
*
798+
*
799799
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
800800
* @see http://github.com/garycourt/murmurhash-js
801801
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
802802
* @see http://sites.google.com/site/murmurhash/
803-
*
803+
*
804804
* @param {string} str ASCII only
805805
* @param {number} seed Positive integer only
806806
* @return {number} 32-bit positive integer hash
@@ -812,14 +812,14 @@
812812
h = seed ^ l,
813813
i = 0,
814814
k;
815-
815+
816816
while (l >= 4) {
817-
k =
817+
k =
818818
((str.charCodeAt(i) & 0xff)) |
819819
((str.charCodeAt(++i) & 0xff) << 8) |
820820
((str.charCodeAt(++i) & 0xff) << 16) |
821821
((str.charCodeAt(++i) & 0xff) << 24);
822-
822+
823823
k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
824824
k ^= k >>> 24;
825825
k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
@@ -829,7 +829,7 @@
829829
l -= 4;
830830
++i;
831831
}
832-
832+
833833
switch (l) {
834834
case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
835835
case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
@@ -903,9 +903,7 @@
903903
get: function(key, def){
904904
_checkKey(key);
905905
if(key in _storage){
906-
if(_storage[key] && typeof _storage[key] == "object" &&
907-
_storage[key]._is_xml &&
908-
_storage[key]._is_xml){
906+
if(_storage[key] && typeof _storage[key] == "object" && _storage[key]._is_xml) {
909907
return _XMLService.decode(_storage[key].xml);
910908
}else{
911909
return _storage[key];

0 commit comments

Comments
 (0)