Skip to content

Commit

Permalink
Make constants constexpr. Pass them to Is(External|Internal)Reference
Browse files Browse the repository at this point in the history
  • Loading branch information
FreePhoenix888 committed Apr 14, 2022
1 parent 77fba07 commit 878455e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp/Platform.Data/ILinksExtensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
template<typename TStorage>
static bool Exists(const TStorage& storage, typename TStorage::LinkAddressType linkAddress) noexcept
{
auto constants = storage.Constants;
return IsExternalReference(constants, linkAddress) || (IsInternalReference(constants, linkAddress) && Count(storage, linkAddress) > 0);
constexpr auto constants = storage.Constants;
return IsExternalReference<typename TStorage::LinkAddressType, constants>(linkAddress) || (IsInternalReference<typename TStorage::LinkAddressType, constants>(linkAddress) && Count(storage, linkAddress) > 0);
}

template<typename TStorage>
Expand All @@ -93,10 +93,10 @@
template<typename TStorage>
static std::vector<typename TStorage::LinkAddressType> GetLink(const TStorage& storage, typename TStorage::LinkAddressType linkAddress)
{
auto constants = storage.Constants;
constexpr auto constants = storage.Constants;
auto $continue = constants.Continue;
auto any = constants.Any;
if (IsExternalReference(constants, linkAddress))
if (IsExternalReference<typename TStorage::LinkAddressType, constants>(linkAddress))
{
std::vector<typename TStorage::LinkAddressType> resultLink {linkAddress, linkAddress, linkAddress};
return resultLink;
Expand Down

0 comments on commit 878455e

Please sign in to comment.