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;
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 aShowName, bool aInheritProperties ) :
column( aColumn ),

View File

@ -980,7 +980,7 @@ bool COMPILER::generateUCode( UCODE* aCode, CONTEXT* aPreflightContext )
for( TREE_NODE* pnode : params )
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;
break;
}

View File

@ -310,31 +310,31 @@ void PROPERTY_MANAGER::CLASS_DESC::rebuild()
auto collectGroups =
[&]( 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 ) )
{
aSetR.insert( group );
aResultR.emplace_back( group );
}
}
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 ) )
{
aSetR.insert( group );
aResultR.emplace_back( group );
}
}
for( const CLASS_DESC& base : aClassR.m_bases )
aSelf( aSelf, aSetR, aResultR, base );
};
for( const CLASS_DESC& base : aClassR.m_bases )
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
// separate out own groups vs. all groups to fix
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 inherit_properties; ///< Whether or not to inherit properties from symbol field
explicit DATABASE_FIELD_MAPPING( std::string aColumn, std::string aName, bool aVisibleOnAdd,
bool aVisibleInChooser, bool aShowName,
explicit DATABASE_FIELD_MAPPING( const std::string& aColumn, const std::string& aName,
bool aVisibleOnAdd, bool aVisibleInChooser, bool aShowName,
bool aInheritProperties );
};