Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Unified Diff: vm/growable_array.h

Issue 11348026: - GrowableArray::RemoveLast returns the value being removed (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/flow_graph_optimizer.cc ('k') | vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/growable_array.h
===================================================================
--- vm/growable_array.h (revision 14219)
+++ vm/growable_array.h (working copy)
@@ -46,9 +46,11 @@
Last() = value;
}
- void RemoveLast() {
+ T& RemoveLast() {
ASSERT(length_ > 0);
+ T& result = operator[](length_ - 1);
length_--;
+ return result;
}
T& operator[](int index) const {
« no previous file with comments | « vm/flow_graph_optimizer.cc ('k') | vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698