|
806 | 806 | * @return {number} 32-bit positive integer hash
|
807 | 807 | */
|
808 | 808 |
|
809 |
| - function murmurhash2_32_gc(str, seed) { |
810 |
| - var |
811 |
| - l = str.length, |
812 |
| - h = (seed || 0x9747b28c) ^ l, |
813 |
| - i = 0, |
814 |
| - k, |
815 |
| - a = 0xff, |
816 |
| - b = 0xffff, |
817 |
| - c = 0x5bd1e995; |
818 |
| - |
819 |
| - while (l >= 4) { |
820 |
| - k = |
821 |
| - ((str.charCodeAt(i) & a)) | |
822 |
| - ((str.charCodeAt(++i) & a) << 8) | |
823 |
| - ((str.charCodeAt(++i) & a) << 16) | |
824 |
| - ((str.charCodeAt(++i) & a) << 24); |
825 |
| - |
826 |
| - k = (((k & b) * c) + ((((k >>> 16) * c) & b) << 16)); |
827 |
| - k ^= k >>> 24; |
828 |
| - k = (((k & b) * c) + ((((k >>> 16) * c) & b) << 16)); |
829 |
| - |
830 |
| - h = (((h & b) * c) + ((((h >>> 16) * c) & b) << 16)) ^ k; |
831 |
| - |
832 |
| - l -= 4; |
833 |
| - ++i; |
834 |
| - } |
835 |
| - |
836 |
| - switch (l) { |
837 |
| - case 3: h ^= (str.charCodeAt(i + 2) & a) << 16; |
838 |
| - case 2: h ^= (str.charCodeAt(i + 1) & a) << 8; |
839 |
| - case 1: h ^= (str.charCodeAt(i) & a); |
840 |
| - h = (((h & b) * c) + ((((h >>> 16) * c) & b) << 16)); |
841 |
| - } |
842 |
| - |
843 |
| - h ^= h >>> 13; |
844 |
| - h = (((h & b) * c) + ((((h >>> 16) * c) & b) << 16)); |
845 |
| - h ^= h >>> 15; |
846 |
| - |
847 |
| - return h >>> 0; |
848 |
| - } |
| 809 | + function murmurhash2_32_gc(str, seed) { |
| 810 | + var |
| 811 | + l = str.length, |
| 812 | + h = seed ^ l, |
| 813 | + i = 0, |
| 814 | + k; |
| 815 | + |
| 816 | + while (l >= 4) { |
| 817 | + k = |
| 818 | + ((str.charCodeAt(i) & 0xff)) | |
| 819 | + ((str.charCodeAt(++i) & 0xff) << 8) | |
| 820 | + ((str.charCodeAt(++i) & 0xff) << 16) | |
| 821 | + ((str.charCodeAt(++i) & 0xff) << 24); |
| 822 | + |
| 823 | + k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16)); |
| 824 | + k ^= k >>> 24; |
| 825 | + k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16)); |
| 826 | + |
| 827 | + h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k; |
| 828 | + |
| 829 | + l -= 4; |
| 830 | + ++i; |
| 831 | + } |
| 832 | + |
| 833 | + switch (l) { |
| 834 | + case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16; |
| 835 | + case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8; |
| 836 | + case 1: h ^= (str.charCodeAt(i) & 0xff); |
| 837 | + h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)); |
| 838 | + } |
| 839 | + |
| 840 | + h ^= h >>> 13; |
| 841 | + h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)); |
| 842 | + h ^= h >>> 15; |
| 843 | + |
| 844 | + return h >>> 0; |
| 845 | + } |
849 | 846 |
|
850 | 847 | ////////////////////////// PUBLIC INTERFACE /////////////////////////
|
851 | 848 |
|
|
906 | 903 | get: function(key, def){
|
907 | 904 | _checkKey(key);
|
908 | 905 | if(key in _storage){
|
909 |
| - if(_storage[key] && typeof _storage[key] == "object" && |
910 |
| - _storage[key]._is_xml && |
911 |
| - _storage[key]._is_xml){ |
| 906 | + if(_storage[key] && typeof _storage[key] == "object" && _storage[key]._is_xml) { |
912 | 907 | return _XMLService.decode(_storage[key].xml);
|
913 | 908 | }else{
|
914 | 909 | return _storage[key];
|
|
0 commit comments