@@ -288,6 +288,7 @@ inline void PEImage::Init(LPCWSTR pPath, BundleFileLocation bundleFileLocation)
288288
289289 m_path = pPath;
290290 m_path.Normalize ();
291+ m_pathHash = m_path.HashCaseInsensitive ();
291292 m_bundleFileLocation = bundleFileLocation;
292293 SetModuleFileNameHintForDAC ();
293294}
@@ -310,11 +311,7 @@ inline PTR_PEImage PEImage::FindByPath(LPCWSTR pPath, BOOL isInBundle /* = TRUE
310311 int CaseHashHelper (const WCHAR *buffer, COUNT_T count);
311312
312313 PEImageLocator locator (pPath, isInBundle);
313- #ifdef FEATURE_CASE_SENSITIVE_FILESYSTEM
314- DWORD dwHash=path.Hash ();
315- #else
316314 DWORD dwHash = CaseHashHelper (pPath, (COUNT_T) u16_strlen (pPath));
317- #endif
318315 return (PEImage *) s_Images->LookupValue (dwHash, &locator);
319316}
320317
@@ -366,7 +363,7 @@ inline void PEImage::AddToHashMap()
366363 CONTRACTL_END;
367364
368365 _ASSERTE (s_hashLock.OwnedByCurrentThread ());
369- s_Images->InsertValue (GetPathHash () ,this );
366+ s_Images->InsertValue (m_pathHash ,this );
370367 m_bInHashMap=TRUE ;
371368}
372369
@@ -378,31 +375,6 @@ inline BOOL PEImage::Has32BitNTHeaders()
378375 return GetOrCreateLayout (PEImageLayout::LAYOUT_ANY)->Has32BitNTHeaders ();
379376}
380377
381- inline BOOL PEImage::HasPath ()
382- {
383- LIMITED_METHOD_CONTRACT;
384-
385- return !GetPath ().IsEmpty ();
386- }
387-
388- inline ULONG PEImage::GetPathHash ()
389- {
390- CONTRACT (ULONG)
391- {
392- PRECONDITION (HasPath ());
393- MODE_ANY;
394- GC_NOTRIGGER;
395- THROWS;
396- }
397- CONTRACT_END;
398-
399- #ifdef FEATURE_CASE_SENSITIVE_FILESYSTEM
400- RETURN m_path.Hash ();
401- #else
402- RETURN m_path.HashCaseInsensitive ();
403- #endif
404- }
405-
406378inline void PEImage::GetPEKindAndMachine (DWORD* pdwKind, DWORD* pdwMachine)
407379{
408380 CONTRACTL
0 commit comments