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

Unified Diff: src/string-stream.cc

Issue 11688003: Revert r13275 and 13276 (Remove most uses of StringInputBuffer). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « src/runtime.cc ('k') | src/v8conversions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-stream.cc
diff --git a/src/string-stream.cc b/src/string-stream.cc
index fc07d94ded237ee4ca79ebde48fe036680de6910..30519b561046a4012db3260dc96c93f8f2e32953 100644
--- a/src/string-stream.cc
+++ b/src/string-stream.cc
@@ -311,14 +311,14 @@ bool StringStream::Put(String* str) {
bool StringStream::Put(String* str, int start, int end) {
- ConsStringIteratorOp op;
- StringCharacterStream stream(str, &op, start);
- for (int i = start; i < end && stream.HasMore(); i++) {
- uint16_t c = stream.GetNext();
+ StringInputBuffer name_buffer(str);
+ name_buffer.Seek(start);
+ for (int i = start; i < end && name_buffer.has_more(); i++) {
+ int c = name_buffer.GetNext();
if (c >= 127 || c < 32) {
c = '?';
}
- if (!Put(static_cast<char>(c))) {
+ if (!Put(c)) {
return false; // Output was truncated.
}
}
« no previous file with comments | « src/runtime.cc ('k') | src/v8conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698