Skip to content

Commit f42e022

Browse files
committed
[INTERNAL] code cleanup
1 parent d7734d3 commit f42e022

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/main/java/net/seesharpsoft/intellij/plugins/csv/formatter/CsvFormatHelper.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ public class CsvFormatHelper {
2424
public static int getTextLength(ASTNode node, CodeStyleSettings codeStyleSettings) {
2525
CsvCodeStyleSettings csvCodeStyleSettings = codeStyleSettings.getCustomSettings(CsvCodeStyleSettings.class);
2626
String text = node.getText();
27-
int length = 0;
27+
int length = node.getTextLength();
2828
if (csvCodeStyleSettings.TABULARIZE && !csvCodeStyleSettings.WHITE_SPACES_OUTSIDE_QUOTES && text.startsWith("\"")) {
2929
text = text.substring(1, text.length() - 1);
3030
text = BEGIN_WHITE_SPACE_PATTERN.matcher(text).replaceFirst("");
3131
text = END_WHITE_SPACE_PATTERN.matcher(text).replaceFirst("");
3232
length = text.length() + 2;
33-
} else {
34-
length = node.getTextLength();
3533
}
3634
return length;
3735
}
@@ -98,14 +96,6 @@ public static Map<Integer, CsvColumnInfo<ASTNode>> createColumnInfoMap(ASTNode r
9896
return columnInfoMap;
9997
}
10098

101-
public static boolean isFirstFieldOfRecordQuoted(@Nullable CsvBlock block) {
102-
if (block != null && block.getNode().getElementType() == CsvTypes.RECORD) {
103-
List<Block> subBlocks = block.buildChildren();
104-
return isQuotedField((CsvBlock) subBlocks.get(0));
105-
}
106-
return false;
107-
}
108-
10999
public static boolean isQuotedField(@Nullable CsvBlock block) {
110100
if (block != null && block.getNode().getElementType() == CsvTypes.FIELD) {
111101
List<Block> subBlocks = block.buildChildren();

0 commit comments

Comments
 (0)