src/share/vm/utilities/growableArray.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7147744 Cdiff src/share/vm/utilities/growableArray.hpp

src/share/vm/utilities/growableArray.hpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 290,305 **** --- 290,315 ---- } } ShouldNotReachHere(); } + // The order is preserved. void remove_at(int index) { assert(0 <= index && index < _len, "illegal index"); for (int j = index + 1; j < _len; j++) _data[j-1] = _data[j]; _len--; } + // The order is changed. + void delete_at(int index) { + assert(0 <= index && index < _len, "illegal index"); + if (index < --_len) { + // Replace removed element with last one. + _data[index] = _data[_len]; + } + } + // inserts the given element before the element at index i void insert_before(const int idx, const E& elem) { check_nesting(); if (_len == _max) grow(_len); for (int j = _len - 1; j >= idx; j--) {
src/share/vm/utilities/growableArray.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File