Skip to content

Commit

Permalink
Delete unused RedirectFunctor abstraction (#108113)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas authored Sep 23, 2024
1 parent 65061ad commit e3c9281
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
35 changes: 6 additions & 29 deletions src/coreclr/vm/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2243,8 +2243,7 @@ CorNativeLinkType MethodTable::GetCharSet()
// Helper routines for the macros defined at the top of this class.
// You probably should not use these functions directly.
//
template<typename RedirectFunctor>
SString &MethodTable::_GetFullyQualifiedNameForClassNestedAwareInternal(SString &ssBuf)
SString &MethodTable::_GetFullyQualifiedNameForClassNestedAware(SString &ssBuf)
{
CONTRACTL {
THROWS;
Expand All @@ -2271,10 +2270,8 @@ SString &MethodTable::_GetFullyQualifiedNameForClassNestedAwareInternal(SString
DWORD dwAttr;
IfFailThrow(pImport->GetTypeDefProps(GetCl(), &dwAttr, NULL));

RedirectFunctor redirectFunctor;
if (IsTdNested(dwAttr))
{
StackSString ssFullyQualifiedName;
StackSString ssPath;

// Build the nesting chain.
Expand All @@ -2288,43 +2285,23 @@ SString &MethodTable::_GetFullyQualifiedNameForClassNestedAwareInternal(SString
&szEnclNameSpace));

ns::MakePath(ssPath,
StackSString(SString::Utf8, redirectFunctor(szEnclNameSpace)),
StackSString(SString::Utf8, szEnclNameSpace),
StackSString(SString::Utf8, szEnclName));

ssFullyQualifiedName.Clear();
ssFullyQualifiedName.Append(ssPath);
ssFullyQualifiedName.Append('+');
ssFullyQualifiedName.Append(ssName);
ssPath.Append('+');
ssPath.Append(ssName);

ssName = ssFullyQualifiedName;
ssName = ssPath;
}
}

ns::MakePath(
ssBuf,
StackSString(SString::Utf8, redirectFunctor(pszNamespace)), ssName);
StackSString(SString::Utf8, pszNamespace), ssName);

return ssBuf;
}

class PassThrough
{
public :
LPCUTF8 operator() (LPCUTF8 szEnclNamespace)
{
LIMITED_METHOD_CONTRACT;

return szEnclNamespace;
}
};

SString &MethodTable::_GetFullyQualifiedNameForClassNestedAware(SString &ssBuf)
{
LIMITED_METHOD_CONTRACT;

return _GetFullyQualifiedNameForClassNestedAwareInternal<PassThrough>(ssBuf);
}

//*******************************************************************************
SString &MethodTable::_GetFullyQualifiedNameForClass(SString &ssBuf)
{
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/vm/methodtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -3038,9 +3038,6 @@ public :
SString &_GetFullyQualifiedNameForClass(SString &ssBuf);
LPCUTF8 GetFullyQualifiedNameInfo(LPCUTF8 *ppszNamespace);

private:
template<typename RedirectFunctor> SString &_GetFullyQualifiedNameForClassNestedAwareInternal(SString &ssBuf);

public :
//-------------------------------------------------------------------
// Debug Info
Expand Down

0 comments on commit e3c9281

Please sign in to comment.