|
|
@@ -94,7 +94,7 @@ public class Compressor {
|
|
|
* @param result 存放压缩结果
|
|
|
*/
|
|
|
protected void compressLine(StringBuilder content, int start, int end, int lineType, StringBuilder result) {
|
|
|
- // 第一行如果是空行,则不压缩,测试用例:
|
|
|
+ // 第一行如果是空行,需要添加分隔字符,否则会被压缩去除掉该空行,测试用例:
|
|
|
// "id=#(123)\nand" "id=#(123) \nand"
|
|
|
if (lineType == 1) {
|
|
|
boolean isBlank = true;
|
|
|
@@ -106,9 +106,6 @@ public class Compressor {
|
|
|
}
|
|
|
|
|
|
if (isBlank) {
|
|
|
- for (int i = start; i <= end; i++) {
|
|
|
- result.append(content.charAt(i));
|
|
|
- }
|
|
|
result.append(separator);
|
|
|
return ;
|
|
|
}
|