Skip to content
This repository was archived by the owner on Nov 28, 2018. It is now read-only.

Commit b34a584

Browse files
committed
remove unused queue code
1 parent 9eb416f commit b34a584

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

lib/stomp-utils.js

-54
Original file line numberDiff line numberDiff line change
@@ -34,63 +34,9 @@ StompUtils.prototype.really_defined = function(var_to_test) {
3434
return !(var_to_test == null || var_to_test == undefined);
3535
};
3636

37-
// Extend associative array
3837
StompUtils.prototype.extend = function(destination, source) {
3938
for (var property in source) {
4039
destination[property] = source[property];
4140
}
4241
return destination;
4342
};
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

Comments
 (0)