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

Unified Diff: runtime/vm/coverage.cc

Issue 324203003: Add SetLength to GrowableArray and use it in code coverage. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | « no previous file | runtime/vm/growable_array.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/coverage.cc
===================================================================
--- runtime/vm/coverage.cc (revision 37203)
+++ runtime/vm/coverage.cc (working copy)
@@ -23,10 +23,12 @@
GrowableArray<intptr_t>* map) {
const TokenStream& tkns = TokenStream::Handle(script.tokens());
const intptr_t len = ExternalTypedData::Handle(tkns.GetStream()).Length();
- map->Clear();
+ map->SetLength(len);
+#if defined(DEBUG)
for (intptr_t i = 0; i < len; i++) {
- map->Add(-1);
+ (*map)[i] = -1;
}
+#endif
TokenStream::Iterator tkit(tkns, 0, TokenStream::Iterator::kAllTokens);
intptr_t cur_line = script.line_offset() + 1;
while (tkit.CurrentTokenKind() != Token::kEOS) {
« no previous file with comments | « no previous file | runtime/vm/growable_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698