src/share/vm/utilities/growableArray.hpp

changeset 1515
7c57aead6d3e
parent 905
ad8c8ca4ab0f
child 1907
c18cbe5936b8
     1.1 --- a/src/share/vm/utilities/growableArray.hpp	Fri Nov 27 07:56:58 2009 -0800
     1.2 +++ b/src/share/vm/utilities/growableArray.hpp	Thu Nov 12 09:24:21 2009 -0800
     1.3 @@ -278,6 +278,17 @@
     1.4      _len--;
     1.5    }
     1.6  
     1.7 +  // inserts the given element before the element at index i
     1.8 +  void insert_before(const int idx, const E& elem) {
     1.9 +    check_nesting();
    1.10 +    if (_len == _max) grow(_len);
    1.11 +    for (int j = _len - 1; j >= idx; j--) {
    1.12 +      _data[j + 1] = _data[j];
    1.13 +    }
    1.14 +    _len++;
    1.15 +    _data[idx] = elem;
    1.16 +  }
    1.17 +
    1.18    void appendAll(const GrowableArray<E>* l) {
    1.19      for (int i = 0; i < l->_len; i++) {
    1.20        raw_at_put_grow(_len, l->_data[i], 0);

mercurial