Skip to content

Commit

Permalink
Renamed GetNull -> GetNullValueForNullableType
Browse files Browse the repository at this point in the history
  • Loading branch information
hicklin committed Jul 7, 2023
1 parent 2d4cca0 commit 09488ec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/AttributePersistenceProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class AttributePersistenceProvider
* @return A value of type T that in the KVS represents null.
*/
template <typename T, std::enable_if_t<std::is_same<bool, T>::value, bool> = true>
static uint8_t GetNull()
static uint8_t GetNullValueForNullableType()
{
return 0xff;
}
Expand All @@ -90,7 +90,7 @@ class AttributePersistenceProvider
* @return A value of type T that in the KVS represents null.
*/
template <typename T, std::enable_if_t<std::is_unsigned<T>::value && !std::is_same<bool, T>::value, bool> = true>
static T GetNull()
static T GetNullValueForNullableType()
{
T nullValue = 0;
nullValue = T(~nullValue);
Expand All @@ -103,7 +103,7 @@ class AttributePersistenceProvider
* @return A value of type T that in the KVS represents null.
*/
template <typename T, std::enable_if_t<std::is_signed<T>::value && !std::is_same<bool, T>::value, bool> = true>
static T GetNull()
static T GetNullValueForNullableType()
{
T nullValue;
nullValue = 1u << ((sizeof(nullValue) * 8) - 1);
Expand Down Expand Up @@ -167,7 +167,7 @@ class AttributePersistenceProvider
{
if (aValue.IsNull())
{
auto nullVal = GetNull<T>();
auto nullVal = GetNullValueForNullableType<T>();
return WriteScalarValue(aPath, nullVal);
}
return WriteScalarValue(aPath, aValue.Value());
Expand All @@ -190,7 +190,7 @@ class AttributePersistenceProvider
return err;
}

if (tempIntegral == GetNull<T>())
if (tempIntegral == GetNullValueForNullableType<T>())
{
aValue.SetNull();
return CHIP_NO_ERROR;
Expand All @@ -217,7 +217,7 @@ class AttributePersistenceProvider
return err;
}

if (tempIntegral == GetNull<T>())
if (tempIntegral == GetNullValueForNullableType<T>())
{
aValue.SetNull();
return CHIP_NO_ERROR;
Expand Down

0 comments on commit 09488ec

Please sign in to comment.