LGTM modulo stylistic comments
http://codereview.chromium.org/7537023/diff/1/src/d8.cc File src/d8.cc (right): http://codereview.chromium.org/7537023/diff/1/src/d8.cc#newcode235 src/d8.cc:235: length = static_cast<int>(strlen(buffer)); Using size_t for length gets rid of the cast. Furthermore, move declation into this loop, keeping the scope as small as possible. http://codereview.chromium.org/7537023/diff/1/src/d8.cc#newcode236 src/d8.cc:236: if (length == 0) return accumulator; In general, a simple if-then-else cascade is easier to read than nested logic, e.g. in our concrete example: if (length == 0) { // should never happen, but anyway... return accumulator; } else if (buffer[length-1] != '\n') { // line doesn't fit into buffer, continue reading String::Concat(accumulator, String::New(buffer, length)); } else if (length >= 2 && buffer[length-2] == '\\') { // continuation line: replace backslash by newline and continue reading buffer[length-2] = '\n'; String::Concat(accumulator, String::New(buffer, length - 1)); } else { // normal line, fitting into buffer return String::Concat(accumulator, String::New(buffer, length - 1)); } http://codereview.chromium.org/7537023/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
