InsertAt apparently inserts by moving the other elements... that does not work.
Review URL: https://chromiumcodereview.appspot.com/
14566007
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14535
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
number_of_valid_maps++;
if (handler_to_overwrite >= 0) {
- handlers.InsertAt(handler_to_overwrite, code);
+ handlers.Set(handler_to_overwrite, code);
} else {
receiver_maps.Add(new_receiver_map);
handlers.Add(code);
}
+template<typename T, class P>
+void List<T, P>::Set(int index, const T& elm) {
+ ASSERT(index >= 0 && index <= length_);
+ data_[index] = elm;
+}
+
+
template<typename T, class P>
void List<T, P>::InsertAt(int index, const T& elm, P alloc) {
ASSERT(index >= 0 && index <= length_);
void InsertAt(int index, const T& element,
AllocationPolicy allocator = AllocationPolicy());
+ // Overwrites the element at the specific index.
+ void Set(int index, const T& element);
+
// Added 'count' elements with the value 'value' and returns a
// vector that allows access to the elements. The vector is valid
// until the next change is made to this list.