summaryrefslogtreecommitdiff
path: root/includes/js/dojox/encoding/compression/splay.js
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/encoding/compression/splay.js
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadsemanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz
semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/encoding/compression/splay.js')
-rw-r--r--includes/js/dojox/encoding/compression/splay.js64
1 files changed, 0 insertions, 64 deletions
diff --git a/includes/js/dojox/encoding/compression/splay.js b/includes/js/dojox/encoding/compression/splay.js
deleted file mode 100644
index 5902380..0000000
--- a/includes/js/dojox/encoding/compression/splay.js
+++ /dev/null
@@ -1,64 +0,0 @@
-if(!dojo._hasResource["dojox.encoding.compression.splay"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojox.encoding.compression.splay"] = true;
-dojo.provide("dojox.encoding.compression.splay");
-dojo.require("dojox.encoding.bits");
-
-dojox.encoding.compression.Splay = function(n){
- this.up = new Array(2 * n + 1);
- this.left = new Array(n);
- this.right = new Array(n);
- this.reset();
-};
-
-dojo.extend(dojox.encoding.compression.Splay, {
- reset: function(){
- for(var i = 1; i < this.up.length; this.up[i] = Math.floor((i - 1) / 2), ++i);
- for(var i = 0; i < this.left.length; this.left[i] = 2 * i + 1, this.right[i] = 2 * i + 2, ++i);
- },
- splay: function(i){
- var a = i + this.left.length;
- do{
- var c = this.up[a];
- if(c){ // root
- // rotated pair
- var d = this.up[c];
- // swap descendants
- var b = this.left[d];
- if(c == b){
- b = this.right[d];
- this.right[d] = a;
- } else {
- this.left[d] = a;
- }
- this[a == this.left[c] ? "left" : "right"][c] = b;
- this.up[a] = d;
- this.up[b] = c;
- a = d;
- }else{
- a = c;
- }
- }while(a); // root
- },
- encode: function(value, stream){
- var s = [], a = value + this.left.length;
- do{
- s.push(this.right[this.up[a]] == a);
- a = this.up[a];
- }while(a); // root
- this.splay(value);
- var l = s.length;
- while(s.length){ stream.putBits(s.pop() ? 1 : 0, 1); }
- return l;
- },
- decode: function(stream){
- var a = 0; // root;
- do{
- a = this[stream.getBits(1) ? "right" : "left"][a];
- }while(a < this.left.length);
- a -= this.left.length;
- this.splay(a);
- return a;
- }
-});
-
-}