| @@ -145,11 +145,20 @@ | ||
| 145 | 145 | * |
| 146 | 146 | * @return {boolean} Whether any queue object/element contains the ID. |
| 147 | 147 | */ |
| 148 | 148 | this.contains_id = function (id) { |
| 149 | - return queue.some(function (ele) { | |
| 150 | - return ele.optimization_id === id; | |
| 149 | + return queue.slice(offset).some(function (ele) { | |
| 150 | + return ele && typeof ele === 'object' && ele.optimization_id === id; | |
| 151 | 151 | }); |
| 152 | + } | |
| 153 | + | |
| 154 | + /** | |
| 155 | + * Returns a copy of all items currently in the queue. | |
| 156 | + * | |
| 157 | + * @returns {Array} - An array of all current items in the queue. | |
| 158 | + */ | |
| 159 | + this.get_all_items = function () { | |
| 160 | + return queue.slice(offset); | |
| 152 | 161 | } |
| 153 | 162 | |
| 154 | 163 | } |
| 155 | 164 | |