Skip to content

Commit

Permalink
Remove useless ShardingSphereTable.putColumn (#33787)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Nov 24, 2024
1 parent 65011f9 commit fb882f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public List<String> getVisibleColumnNames(final String tableName) {
* @return visible column names and indexes
*/
public Map<String, Integer> getVisibleColumnNamesAndIndexes(final String tableName) {
return containsTable(tableName) ? getTable(tableName).getVisibleColumnsAndIndexes() : Collections.emptyMap();
return containsTable(tableName) ? getTable(tableName).getVisibleColumnsAndIndexMap() : Collections.emptyMap();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public final class ShardingSphereTable {

private final List<String> visibleColumns = new ArrayList<>();

private final Map<String, Integer> visibleColumnsAndIndexes = new CaseInsensitiveMap<>();
private final Map<String, Integer> visibleColumnsAndIndexMap = new CaseInsensitiveMap<>();

private final List<String> primaryKeyColumns = new ArrayList<>();

Expand All @@ -64,11 +64,7 @@ public ShardingSphereTable() {

public ShardingSphereTable(final String name, final Collection<ShardingSphereColumn> columns,
final Collection<ShardingSphereIndex> indexes, final Collection<ShardingSphereConstraint> constraints) {
this.name = name;
this.columns = createColumns(columns);
this.indexes = createIndexes(indexes);
this.constraints = createConstraints(constraints);
type = TableType.TABLE;
this(name, columns, indexes, constraints, TableType.TABLE);
}

public ShardingSphereTable(final String name, final Collection<ShardingSphereColumn> columns,
Expand All @@ -91,7 +87,7 @@ private Map<ShardingSphereMetaDataIdentifier, ShardingSphereColumn> createColumn
}
if (each.isVisible()) {
visibleColumns.add(each.getName());
visibleColumnsAndIndexes.put(each.getName(), index++);
visibleColumnsAndIndexMap.put(each.getName(), index++);
}
}
return result;
Expand All @@ -113,15 +109,6 @@ private Map<String, ShardingSphereConstraint> createConstraints(final Collection
return result;
}

/**
* Put column meta data.
*
* @param column column meta data
*/
public void putColumn(final ShardingSphereColumn column) {
columns.put(new ShardingSphereMetaDataIdentifier(column.getName()), column);
}

/**
* Get column meta data via column name.
*
Expand Down

0 comments on commit fb882f2

Please sign in to comment.