diff --git a/hal/src/main/native/include/hal/I2CTypes.h b/hal/src/main/native/include/hal/I2CTypes.h index e1339f0140a..41b670868fe 100644 --- a/hal/src/main/native/include/hal/I2CTypes.h +++ b/hal/src/main/native/include/hal/I2CTypes.h @@ -27,7 +27,7 @@ namespace hal { * A move-only C++ wrapper around HAL_I2CPort. * Does not ensure destruction. */ -using I2CPort = Handle; +using I2CPort = Handle; } // namespace hal #endif diff --git a/hal/src/main/native/include/hal/SPITypes.h b/hal/src/main/native/include/hal/SPITypes.h index b27c38828e9..83cdc2151b8 100644 --- a/hal/src/main/native/include/hal/SPITypes.h +++ b/hal/src/main/native/include/hal/SPITypes.h @@ -49,7 +49,7 @@ namespace hal { * A move-only C++ wrapper around HAL_SPIPort. * Does not ensure destruction. */ -using SPIPort = Handle; +using SPIPort = Handle; } // namespace hal #endif diff --git a/hal/src/main/native/include/hal/Types.h b/hal/src/main/native/include/hal/Types.h index 517f83852ba..224103c44b3 100644 --- a/hal/src/main/native/include/hal/Types.h +++ b/hal/src/main/native/include/hal/Types.h @@ -92,7 +92,7 @@ namespace hal { * A move-only C++ wrapper around a HAL handle. * Will free the handle if FreeFunction is provided */ -template class Handle { public: @@ -111,10 +111,8 @@ class Handle { } ~Handle() { - if constexpr (FreeFunction != nullptr) { - if (m_handle != CInvalid) { - FreeFunction(m_handle); - } + if (m_handle != CInvalid) { + FreeFunction(m_handle); } }