mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 15:15:23 +00:00
Add a contains method to Queue.
This commit is contained in:
parent
9c88e4b9fb
commit
2d0cef9e4a
@ -87,6 +87,13 @@ public:
|
||||
free(_data);
|
||||
}
|
||||
|
||||
bool contains(T a) {
|
||||
for (unsigned n = 0; n < _len; ++n)
|
||||
if (_data[n] == a)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void add(T a) {
|
||||
JS_ASSERT(_len <= _max);
|
||||
ensure(_len + 1);
|
||||
|
Loading…
Reference in New Issue
Block a user