From 2b460bc1ff7f85fd6596c63e1eb584aaad8a2984 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 24 Jan 2018 19:37:07 -0500 Subject: [PATCH] Eeschema: improve alias load performance. Don't use wxFileName == operator when comparing cache file name. There is a lot of overhead the wxFileName == operator that is not necessary so just do a comparison with the original string used to create the cache. --- eeschema/sch_legacy_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_legacy_plugin.cpp b/eeschema/sch_legacy_plugin.cpp index 5b5d88a25a..5dab47f2b7 100644 --- a/eeschema/sch_legacy_plugin.cpp +++ b/eeschema/sch_legacy_plugin.cpp @@ -471,6 +471,7 @@ class SCH_LEGACY_PLUGIN_CACHE { static int m_modHash; // Keep track of the modification status of the library. + wxString m_fileName; // Absolute path and file name. wxFileName m_libFileName; // Absolute path and file name is required here. wxDateTime m_fileModTime; LIB_ALIAS_MAP m_aliases; // Map of names of LIB_ALIAS pointers. @@ -2140,6 +2141,7 @@ int SCH_LEGACY_PLUGIN_CACHE::m_modHash = 1; // starts at 1 and goes up SCH_LEGACY_PLUGIN_CACHE::SCH_LEGACY_PLUGIN_CACHE( const wxString& aFullPathAndFileName ) : + m_fileName( aFullPathAndFileName ), m_libFileName( aFullPathAndFileName ), m_isWritable( true ), m_isModified( false ) @@ -2183,7 +2185,7 @@ wxDateTime SCH_LEGACY_PLUGIN_CACHE::GetLibModificationTime() bool SCH_LEGACY_PLUGIN_CACHE::IsFile( const wxString& aFullPathAndFileName ) const { - return m_libFileName == aFullPathAndFileName; + return m_fileName == aFullPathAndFileName; }