@@ -34,63 +34,9 @@ StompUtils.prototype.really_defined = function(var_to_test) {
34
34
return ! ( var_to_test == null || var_to_test == undefined ) ;
35
35
} ;
36
36
37
- // Extend associative array
38
37
StompUtils . prototype . extend = function ( destination , source ) {
39
38
for ( var property in source ) {
40
39
destination [ property ] = source [ property ] ;
41
40
}
42
41
return destination ;
43
42
} ;
44
-
45
- /**
46
- * Queueing implementation, blatantly ripped off from:
47
- * http://safalra.com/web-design/javascript/queues/Queue.js
48
- * only really semantics have been changed.
49
- */
50
- StompQueue = exports . StompQueue = function ( ) {
51
- this . queue = [ ] ;
52
- this . queue_space = 0 ;
53
- } ;
54
-
55
- StompQueue . prototype . get_size = function ( ) {
56
- return this . queue . length - this . queue_space ;
57
- } ;
58
-
59
- StompQueue . prototype . is_empty = function ( ) {
60
- return ( this . queue . length == 0 ) ;
61
- } ;
62
-
63
- StompQueue . prototype . put = function ( item ) {
64
- this . queue . push ( item ) ;
65
- } ;
66
-
67
- StompQueue . prototype . get = function ( ) {
68
- var item = undefined ;
69
-
70
- if ( this . queue . length ) {
71
- item = this . queue [ this . queue_space ] ;
72
-
73
- if ( ++ this . queue_space * 2 >= this . queue . length ) {
74
- this . queue = this . queue . slice ( this . queue_space ) ;
75
- this . queue_space = 0 ;
76
- }
77
- }
78
-
79
- if ( item == undefined )
80
- throw new QueueEmpty ( ) ;
81
-
82
- return item ;
83
- } ;
84
-
85
- StompQueue . prototype . get_oldest_item = function ( ) {
86
- var item = undefined ;
87
-
88
- if ( this . queue . length ) {
89
- item = this . queue [ this . queue_space ] ;
90
- }
91
- else {
92
- throw new QueueEmpty ( ) ;
93
- }
94
-
95
- return item ;
96
- } ;
0 commit comments