File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
src/main/java/io/r2dbc/postgresql Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,7 @@ final class PostgresqlRow implements io.r2dbc.postgresql.api.PostgresqlRow {
5959 this .data = Assert .requireNonNull (data , "data must not be null" );
6060
6161 if (metadata instanceof PostgresqlRowMetadata ) {
62- this .columnNameIndexCacheMap = Assert .requireNonNull (
63- ((PostgresqlRowMetadata ) metadata ).getColumnNameIndexMap (),
64- "columnNameIndexCacheMap must not be null" );
62+ this .columnNameIndexCacheMap = ((PostgresqlRowMetadata ) metadata ).getColumnNameIndexMap ();
6563 } else {
6664 this .columnNameIndexCacheMap = createColumnNameIndexMap (this .fields );
6765 }
Original file line number Diff line number Diff line change @@ -48,15 +48,13 @@ final class PostgresqlRowMetadata extends AbstractCollection<String> implements
4848
4949 PostgresqlRowMetadata (List <PostgresqlColumnMetadata > columnMetadatas ) {
5050 this .columnMetadatas = Assert .requireNonNull (columnMetadatas , "columnMetadatas must not be null" );
51- this .nameKeyedColumns = new LinkedHashMap <>();
51+ this .nameKeyedColumns = new LinkedHashMap <>(columnMetadatas . size (), 1 );
5252 this .columnNameIndexMap = new HashMap <>(columnMetadatas .size (), 1 );
5353
5454 int i = 0 ;
5555 for (PostgresqlColumnMetadata columnMetadata : columnMetadatas ) {
56- if (!this .nameKeyedColumns .containsKey (columnMetadata .getName ())) {
57- this .nameKeyedColumns .put (columnMetadata .getName (), columnMetadata );
58- }
59- columnNameIndexMap .putIfAbsent (columnMetadata .getName ().toLowerCase (Locale .ROOT ), i ++);
56+ this .nameKeyedColumns .putIfAbsent (columnMetadata .getName (), columnMetadata );
57+ this .columnNameIndexMap .putIfAbsent (columnMetadata .getName ().toLowerCase (Locale .ROOT ), i ++);
6058 }
6159 }
6260
You can’t perform that action at this time.
0 commit comments