Skip to content

Commit

Permalink
Perf fix 1 - Add a null value check upfront in DTV::getValue (#2600)
Browse files Browse the repository at this point in the history
* Perf fix 1 - Add a null value check upfront in dtv::getValue

* Formatting change

* Formatting change

* Formatting change
  • Loading branch information
machavan authored Feb 20, 2025
1 parent 2c3db81 commit b0ff5b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/microsoft/sqlserver/jdbc/dtv.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,11 @@ final JavaType getJavaType() {
Object getValue(JDBCType jdbcType, int scale, InputStreamGetterArgs streamGetterArgs, Calendar cal,
TypeInfo typeInfo, CryptoMetadata cryptoMetadata, TDSReader tdsReader,
SQLServerStatement statement) throws SQLServerException {
if (null == impl)
if (null == impl) {
impl = new ServerDTVImpl();
} else if (impl.isNull()) {
return null;
}
return impl.getValue(this, jdbcType, scale, streamGetterArgs, cal, typeInfo, cryptoMetadata, tdsReader,
statement);
}
Expand Down

0 comments on commit b0ff5b1

Please sign in to comment.