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

Unified Diff: runtime/vm/object.cc

Issue 116343004: Some cleanups (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 7c817e13af4005381536f2e88fe53628362d766c..3be70ddfc1d04f47bf94aa62ef48a5deb5c43604 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -1875,19 +1875,19 @@ RawFunction* Class::LookupClosureFunction(intptr_t token_pos) const {
}
intptr_t Class::FindClosureIndex(intptr_t token_pos) const {
- if (raw_ptr()->closure_functions_ == GrowableObjectArray::null()) {
+ if (closures() == GrowableObjectArray::null()) {
return -1;
}
Isolate* isolate = Isolate::Current();
ReusableHandleScope reused_handles(isolate);
- const GrowableObjectArray& closures =
- GrowableObjectArray::Handle(isolate, raw_ptr()->closure_functions_);
+ const GrowableObjectArray& closures_array =
+ GrowableObjectArray::Handle(isolate, closures());
Function& closure = reused_handles.FunctionHandle();
- intptr_t num_closures = closures.Length();
+ intptr_t num_closures = closures_array.Length();
intptr_t best_fit_token_pos = -1;
intptr_t best_fit_index = -1;
for (intptr_t i = 0; i < num_closures; i++) {
- closure ^= closures.At(i);
+ closure ^= closures_array.At(i);
ASSERT(!closure.IsNull());
if ((closure.token_pos() <= token_pos) &&
(token_pos <= closure.end_token_pos()) &&
@@ -2472,7 +2472,7 @@ intptr_t Class::FindFieldIndex(const Field& needle) const {
return i;
}
}
- // No field found found.
+ // No field found.
return -1;
}
@@ -14556,39 +14556,30 @@ RawString* String::DecodeURI(const String& str) {
CodePointIterator cpi(str);
intptr_t num_escapes = 0;
intptr_t len = str.Length();
- bool valid = true;
{
CodePointIterator cpi(str);
- while (valid && cpi.Next()) {
+ while (cpi.Next()) {
int32_t code_point = cpi.Current();
if (IsPercent(code_point)) {
// Verify that the two characters following the % are hex digits.
if (!cpi.Next()) {
- valid = false;
- break;
+ return str.raw();
}
int32_t code_point = cpi.Current();
if (!IsHexCharacter(code_point)) {
- valid = false;
- break;
+ return str.raw();
}
if (!cpi.Next()) {
- valid = false;
- break;
+ return str.raw();
}
code_point = cpi.Current();
if (!IsHexCharacter(code_point)) {
- valid = false;
- break;
+ return str.raw();
}
num_escapes += 2;
}
}
}
- if (!valid) {
- // Invalid, return original string.
- return str.raw();
- }
ASSERT(len - num_escapes > 0);
const String& dststr = String::Handle(
OneByteString::New(len - num_escapes, Heap::kNew));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698