Performance optimizations for database libraries.

(cherry picked from commit e68df8e1d1)
This commit is contained in:
Alex Shvartzkop
2024-02-23 20:29:18 +03:00
parent e5896374e3
commit cb25c8620e
8 changed files with 106 additions and 54 deletions
+13 -5
View File
@@ -32,6 +32,17 @@
const int dblibSchemaVersion = 1;
DATABASE_FIELD_MAPPING::DATABASE_FIELD_MAPPING( std::string aColumn, std::string aName,
bool aVisibleOnAdd, bool aVisibleInChooser,
bool aShowName, bool aInheritProperties ) :
column( aColumn ),
name( aName ), name_wx( aName.c_str(), wxConvUTF8 ), visible_on_add( aVisibleOnAdd ),
visible_in_chooser( aVisibleInChooser ), show_name( aShowName ),
inherit_properties( aInheritProperties )
{
}
DATABASE_LIB_SETTINGS::DATABASE_LIB_SETTINGS( const std::string& aFilename ) :
JSON_SETTINGS( aFilename, SETTINGS_LOC::NONE, dblibSchemaVersion )
{
@@ -113,11 +124,8 @@ DATABASE_LIB_SETTINGS::DATABASE_LIB_SETTINGS( const std::string& aFilename ) :
bool inherit = fetchOrDefault<bool>( fieldJson, "inherit_properties" );
table.fields.emplace_back(
DATABASE_FIELD_MAPPING(
{
column, name, visible_on_add, visible_in_chooser, show_name,
inherit
} ) );
DATABASE_FIELD_MAPPING( column, name, visible_on_add,
visible_in_chooser, show_name, inherit ) );
}
}