Performance tweaks.

This commit is contained in:
Jeff Young 2025-06-09 16:40:15 +01:00
parent 8235843d01
commit 3d5a87d8db
4 changed files with 22 additions and 22 deletions

View File

@ -33,7 +33,7 @@
const int dblibSchemaVersion = 1; const int dblibSchemaVersion = 1;
DATABASE_FIELD_MAPPING::DATABASE_FIELD_MAPPING( std::string aColumn, std::string aName, DATABASE_FIELD_MAPPING::DATABASE_FIELD_MAPPING( const std::string& aColumn, const std::string& aName,
bool aVisibleOnAdd, bool aVisibleInChooser, bool aVisibleOnAdd, bool aVisibleInChooser,
bool aShowName, bool aInheritProperties ) : bool aShowName, bool aInheritProperties ) :
column( aColumn ), column( aColumn ),

View File

@ -980,7 +980,7 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
for( TREE_NODE* pnode : params ) for( TREE_NODE* pnode : params )
stack.push_back( pnode ); stack.push_back( pnode );
node->leaf[1]->SetUop( TR_OP_METHOD_CALL, func, std::move( vref ) ); node->leaf[1]->SetUop( TR_OP_METHOD_CALL, std::move( func ), std::move( vref ) );
node->isTerminal = false; node->isTerminal = false;
break; break;
} }

View File

@ -310,31 +310,31 @@ void PROPERTY_MANAGER::CLASS_DESC::rebuild()
auto collectGroups = auto collectGroups =
[&]( std::set<wxString>& aSet, std::vector<wxString>& aResult ) [&]( std::set<wxString>& aSet, std::vector<wxString>& aResult )
{
auto collectGroupsRecursive =
[]( auto& aSelf, std::set<wxString>& aSetR, std::vector<wxString>& aResultR,
const CLASS_DESC& aClassR ) -> void
{
for( const wxString& group : aClassR.m_groupDisplayOrder )
{ {
if( !aSetR.count( group ) ) auto collectGroupsRecursive =
{ []( auto& aSelf, std::set<wxString>& aSetR, std::vector<wxString>& aResultR,
aSetR.insert( group ); const CLASS_DESC& aClassR ) -> void
aResultR.emplace_back( group ); {
} for( const wxString& group : aClassR.m_groupDisplayOrder )
} {
if( !aSetR.count( group ) )
{
aSetR.insert( group );
aResultR.emplace_back( group );
}
}
for( const CLASS_DESC& base : aClassR.m_bases ) for( const CLASS_DESC& base : aClassR.m_bases )
aSelf( aSelf, aSetR, aResultR, base ); aSelf( aSelf, aSetR, aResultR, base );
}; };
collectGroupsRecursive( collectGroupsRecursive, aSet, aResult, *this ); collectGroupsRecursive( collectGroupsRecursive, aSet, aResult, *this );
}; };
// TODO(JE): This currently relies on rebuild() happening after all properties are added // TODO(JE): This currently relies on rebuild() happening after all properties are added
// separate out own groups vs. all groups to fix // separate out own groups vs. all groups to fix
collectGroups( groups, displayOrder ); collectGroups( groups, displayOrder );
m_groupDisplayOrder = displayOrder; m_groupDisplayOrder = std::move( displayOrder );
} }

View File

@ -53,8 +53,8 @@ struct KICOMMON_API DATABASE_FIELD_MAPPING
bool show_name; ///< Whether or not to show the field name as well as its value bool show_name; ///< Whether or not to show the field name as well as its value
bool inherit_properties; ///< Whether or not to inherit properties from symbol field bool inherit_properties; ///< Whether or not to inherit properties from symbol field
explicit DATABASE_FIELD_MAPPING( std::string aColumn, std::string aName, bool aVisibleOnAdd, explicit DATABASE_FIELD_MAPPING( const std::string& aColumn, const std::string& aName,
bool aVisibleInChooser, bool aShowName, bool aVisibleOnAdd, bool aVisibleInChooser, bool aShowName,
bool aInheritProperties ); bool aInheritProperties );
}; };