Refactored 2 alternate slices in scanBlockScalar into one.

This commit is contained in:
Ferdinand Majerech 2014-07-25 23:50:04 +02:00
parent 0aa321f8c5
commit 6dbe9ad4ae

View file

@ -1165,23 +1165,20 @@ final class Scanner
//Determine the indentation level and go to the first non-empty line. //Determine the indentation level and go to the first non-empty line.
Mark endMark; Mark endMark;
dstring breaks;
uint indent = max(1, indent_ + 1); uint indent = max(1, indent_ + 1);
reader_.sliceBuilder.begin();
if(increment == int.min) if(increment == int.min)
{ {
reader_.sliceBuilder.begin();
auto indentation = scanBlockScalarIndentationToSlice(); auto indentation = scanBlockScalarIndentationToSlice();
breaks = reader_.sliceBuilder.finish();
endMark = indentation[1]; endMark = indentation[1];
indent = max(indent, indentation[0]); indent = max(indent, indentation[0]);
} }
else else
{ {
indent += increment - 1; indent += increment - 1;
reader_.sliceBuilder.begin();
endMark = scanBlockScalarBreaksToSlice(indent); endMark = scanBlockScalarBreaksToSlice(indent);
breaks = reader_.sliceBuilder.finish();
} }
dstring breaks = reader_.sliceBuilder.finish();
dchar[] lineBreak = ""d.dup; dchar[] lineBreak = ""d.dup;