Commit ca7668ee authored by lrn@chromium.org's avatar lrn@chromium.org

Fixed typo


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@454 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5c80e6a8
...@@ -1321,18 +1321,18 @@ StringRepresentationTag String::map_representation_tag(Map* map) { ...@@ -1321,18 +1321,18 @@ StringRepresentationTag String::map_representation_tag(Map* map) {
bool String::IsFlat() { bool String::IsFlat() {
String* current = this; switch (this->representation_tag()) {
while (true) {
switch (current->representation_tag()) {
case kConsStringTag: case kConsStringTag:
return String::cast(ConsString::cast(current)->second())->length() == 0; // Only flattened strings have second part empty.
case kSlicedStringTag: return String::cast(ConsString::cast(this)->second())->length() == 0;
current = String::cast(SlicedString::cast(this)->buffer()); case kSlicedStringTag: {
break; String* slice = String::cast(SlicedString::cast(this)->buffer());
StringRepresentationTag tag = slice->representation_tag();
return tag == kSeqStringTag || tag == kExternalStringTag;
}
default: default:
return true; return true;
} }
}
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
function f0() { function f0() {
switch (0) { switch (0) {
// switch deliberatly left empty // switch deliberately left empty
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment