[raknet] Remove RPCMap::AddIdentifierAtIndex(...)

This commit is contained in:
RD42 2024-08-19 21:42:18 +08:00
parent 12ac4bf95b
commit 5c8db97f0d
2 changed files with 0 additions and 48 deletions

View File

@ -104,50 +104,4 @@ void RPCMap::AddIdentifierWithFunction(char *uniqueIdentifier, void *functionPoi
rpcSet.Insert(node); // No empty spots available so just add to the end of the list
}
void RPCMap::AddIdentifierAtIndex(char *uniqueIdentifier, RPCIndex insertionIndex)
{
#ifdef _DEBUG
assert(uniqueIdentifier && uniqueIdentifier[0]);
#endif
unsigned existingNodeIndex;
RPCNode *node, *oldNode;
existingNodeIndex=GetIndexFromFunctionName(uniqueIdentifier);
if (existingNodeIndex==insertionIndex)
return; // Already there
if ((RPCIndex)existingNodeIndex!=UNDEFINED_RPC_INDEX)
{
// Delete the existing one
oldNode=rpcSet[existingNodeIndex];
rpcSet[existingNodeIndex]=0;
delete [] oldNode->uniqueIdentifier;
delete oldNode;
}
node = new RPCNode;
node->uniqueIdentifier = new char [strlen(uniqueIdentifier)+1];
strcpy(node->uniqueIdentifier, uniqueIdentifier);
node->functionPointer=0;
// Insert at a user specified spot
if (insertionIndex < rpcSet.Size())
{
// Overwrite what is there already
oldNode=rpcSet[insertionIndex];
if (oldNode)
{
delete [] oldNode->uniqueIdentifier;
delete oldNode;
}
rpcSet[insertionIndex]=node;
}
else
{
// Insert after the end of the list and use 0 as a filler for the empty spots
rpcSet.Replace(node, 0, insertionIndex);
}
}

View File

@ -38,8 +38,6 @@ public:
RPCNode *GetNodeFromFunctionName(char *uniqueIdentifier);
RPCIndex GetIndexFromFunctionName(char *uniqueIdentifier);
void AddIdentifierWithFunction(char *uniqueIdentifier, void *functionPointer, bool isPointerToMember);
void AddIdentifierAtIndex(char *uniqueIdentifier, RPCIndex insertionIndex);
protected:
DataStructures::List<RPCNode *> rpcSet;
};