File tree 2 files changed +4
-8
lines changed
src/main/java/io/r2dbc/postgresql
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 {
59
59
this .data = Assert .requireNonNull (data , "data must not be null" );
60
60
61
61
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 ();
65
63
} else {
66
64
this .columnNameIndexCacheMap = createColumnNameIndexMap (this .fields );
67
65
}
Original file line number Diff line number Diff line change @@ -48,15 +48,13 @@ final class PostgresqlRowMetadata extends AbstractCollection<String> implements
48
48
49
49
PostgresqlRowMetadata (List <PostgresqlColumnMetadata > columnMetadatas ) {
50
50
this .columnMetadatas = Assert .requireNonNull (columnMetadatas , "columnMetadatas must not be null" );
51
- this .nameKeyedColumns = new LinkedHashMap <>();
51
+ this .nameKeyedColumns = new LinkedHashMap <>(columnMetadatas . size (), 1 );
52
52
this .columnNameIndexMap = new HashMap <>(columnMetadatas .size (), 1 );
53
53
54
54
int i = 0 ;
55
55
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 ++);
60
58
}
61
59
}
62
60
You can’t perform that action at this time.
0 commit comments