Skip to content

Commit cb4581a

Browse files
huoyaoyuanmangod9jkotas
authored
Cleanup some unused code and signature (#112905)
* EventArgs and EventHandler * StringObject::CaseInsensitiveCompHelper * AllocateCharArray --------- Co-authored-by: Manish Godse <[email protected]> Co-authored-by: Jan Kotas <[email protected]>
1 parent 77f71dc commit cb4581a

File tree

4 files changed

+0
-84
lines changed

4 files changed

+0
-84
lines changed

src/coreclr/vm/corelib.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,6 @@ DEFINE_METHOD(ENVIRONMENT, INITIALIZE_COMMAND_LINE_ARGS, InitializeCommand
307307

308308
DEFINE_CLASS(EVENT, Reflection, RuntimeEventInfo)
309309

310-
DEFINE_CLASS(EVENT_ARGS, System, EventArgs)
311-
312-
DEFINE_CLASS(EVENT_HANDLERGENERIC, System, EventHandler`1)
313-
314310
DEFINE_CLASS(EVENT_INFO, Reflection, EventInfo)
315311

316312
DEFINE_CLASS_U(System, Exception, ExceptionObject)

src/coreclr/vm/metasig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@ DEFINE_METASIG(IM(Int_RetBool, i, F))
449449
DEFINE_METASIG(IM(Int_Int_RetVoid, i i, v))
450450
DEFINE_METASIG(IM(Int_Int_Int_RetVoid, i i i, v))
451451
DEFINE_METASIG(IM(Int_Int_Int_Int_RetVoid, i i i i, v))
452-
DEFINE_METASIG_T(IM(Obj_EventArgs_RetVoid, j C(EVENT_ARGS), v))
453452

454453
DEFINE_METASIG_T(IM(Exception_RetVoid, C(EXCEPTION), v))
455454

src/coreclr/vm/object.cpp

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -301,18 +301,6 @@ STRINGREF AllocateString(SString sstr)
301301
return strObj;
302302
}
303303

304-
CHARARRAYREF AllocateCharArray(DWORD dwArrayLength)
305-
{
306-
CONTRACTL
307-
{
308-
THROWS;
309-
GC_TRIGGERS;
310-
MODE_COOPERATIVE;
311-
}
312-
CONTRACTL_END;
313-
return (CHARARRAYREF)AllocatePrimitiveArray(ELEMENT_TYPE_CHAR, dwArrayLength);
314-
}
315-
316304
void Object::ValidateHeap(BOOL bDeep)
317305
{
318306
STATIC_CONTRACT_NOTHROW;
@@ -899,71 +887,6 @@ STRINGREF* StringObject::InitEmptyStringRefPtr() {
899887
return EmptyStringRefPtr;
900888
}
901889

902-
// strAChars must be null-terminated, with an appropriate aLength
903-
// strBChars must be null-terminated, with an appropriate bLength OR bLength == -1
904-
// If bLength == -1, we stop on the first null character in strBChars
905-
BOOL StringObject::CaseInsensitiveCompHelper(_In_reads_(aLength) WCHAR *strAChars, _In_z_ INT8 *strBChars, INT32 aLength, INT32 bLength, INT32 *result) {
906-
CONTRACTL {
907-
NOTHROW;
908-
GC_NOTRIGGER;
909-
MODE_ANY;
910-
PRECONDITION(CheckPointer(strAChars));
911-
PRECONDITION(CheckPointer(strBChars));
912-
PRECONDITION(CheckPointer(result));
913-
} CONTRACTL_END;
914-
915-
WCHAR *strAStart = strAChars;
916-
INT8 *strBStart = strBChars;
917-
unsigned charA;
918-
unsigned charB;
919-
920-
while (true)
921-
{
922-
charA = *strAChars;
923-
charB = (unsigned) *strBChars;
924-
925-
//Case-insensitive comparison on chars greater than 0x7F
926-
//requires a locale-aware casing operation and we're not going there.
927-
if ((charA|charB)>0x7F) {
928-
*result = 0;
929-
return FALSE;
930-
}
931-
932-
// uppercase both chars.
933-
if (charA>='a' && charA<='z') {
934-
charA ^= 0x20;
935-
}
936-
if (charB>='a' && charB<='z') {
937-
charB ^= 0x20;
938-
}
939-
940-
//Return the (case-insensitive) difference between them.
941-
if (charA!=charB) {
942-
*result = (int)(charA-charB);
943-
return TRUE;
944-
}
945-
946-
947-
if (charA==0) // both strings have null character
948-
{
949-
if (bLength == -1)
950-
{
951-
*result = aLength - static_cast<INT32>(strAChars - strAStart);
952-
return TRUE;
953-
}
954-
if (strAChars==strAStart + aLength || strBChars==strBStart + bLength)
955-
{
956-
*result = aLength - bLength;
957-
return TRUE;
958-
}
959-
// else both embedded zeros
960-
}
961-
962-
// Next char
963-
strAChars++; strBChars++;
964-
}
965-
}
966-
967890
/*============================InternalTrailByteCheck============================
968891
**Action: Many years ago, VB didn't have the concept of a byte array, so enterprising
969892
** users created one by allocating a BSTR with an odd length and using it to

src/coreclr/vm/object.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,6 @@ class StringObject : public Object
921921
BOOL HasTrailByte();
922922
BOOL GetTrailByte(BYTE *bTrailByte);
923923
BOOL SetTrailByte(BYTE bTrailByte);
924-
static BOOL CaseInsensitiveCompHelper(_In_reads_(aLength) WCHAR * strA, _In_z_ INT8 * strB, int aLength, int bLength, int *result);
925924

926925
/*=================RefInterpretGetStringValuesDangerousForGC======================
927926
**N.B.: This performs no range checking and relies on the caller to have done this.
@@ -1580,7 +1579,6 @@ typedef PTR_AssemblyNameBaseObject ASSEMBLYNAMEREF;
15801579
#define ArgSlotToBool(s) ((BOOL)(s))
15811580

15821581
STRINGREF AllocateString(SString sstr);
1583-
CHARARRAYREF AllocateCharArray(DWORD dwArrayLength);
15841582

15851583
#ifdef FEATURE_COMINTEROP
15861584

0 commit comments

Comments
 (0)