src/share/vm/utilities/growableArray.hpp

changeset 4037
da91efe96a93
parent 3900
d2a62e0f25eb
child 4245
4735d2c84362
     1.1 --- a/src/share/vm/utilities/growableArray.hpp	Fri Aug 31 16:39:35 2012 -0700
     1.2 +++ b/src/share/vm/utilities/growableArray.hpp	Sat Sep 01 13:25:18 2012 -0400
     1.3 @@ -281,6 +281,13 @@
     1.4      return -1;
     1.5    }
     1.6  
     1.7 +  int  find_from_end(const E& elem) const {
     1.8 +    for (int i = _len-1; i >= 0; i--) {
     1.9 +      if (_data[i] == elem) return i;
    1.10 +    }
    1.11 +    return -1;
    1.12 +  }
    1.13 +
    1.14    int  find(void* token, bool f(void*, E)) const {
    1.15      for (int i = 0; i < _len; i++) {
    1.16        if (f(token, _data[i])) return i;
    1.17 @@ -288,7 +295,7 @@
    1.18      return -1;
    1.19    }
    1.20  
    1.21 -  int  find_at_end(void* token, bool f(void*, E)) const {
    1.22 +  int  find_from_end(void* token, bool f(void*, E)) const {
    1.23      // start at the end of the array
    1.24      for (int i = _len-1; i >= 0; i--) {
    1.25        if (f(token, _data[i])) return i;

mercurial