diff options
author | Upasana <upasana-me@users.noreply.github.com> | 2018-03-05 00:58:41 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-03-05 00:58:41 +0100 |
commit | ed53ecda0546d6c639fa3d227a59ace4d57b81a5 (patch) | |
tree | e716548b5b3b6129396bb559ab2acb32fcfad09d /Bugzilla/Whine | |
parent | 456dd5df6dfc799d72d446541ce5da147917db6e (diff) | |
download | bugzilla-ed53ecda0546d6c639fa3d227a59ace4d57b81a5.tar.gz bugzilla-ed53ecda0546d6c639fa3d227a59ace4d57b81a5.tar.xz |
Bug 1273381 - Improve bugzilla object performance by using Class::XSAccessor for object accessors
Diffstat (limited to 'Bugzilla/Whine')
-rw-r--r-- | Bugzilla/Whine/Query.pm | 9 | ||||
-rw-r--r-- | Bugzilla/Whine/Schedule.pm | 7 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Bugzilla/Whine/Query.pm b/Bugzilla/Whine/Query.pm index 6ea91cc51..885737114 100644 --- a/Bugzilla/Whine/Query.pm +++ b/Bugzilla/Whine/Query.pm @@ -33,15 +33,22 @@ use constant DB_COLUMNS => qw( use constant NAME_FIELD => 'id'; use constant LIST_ORDER => 'sortkey'; +use constant QUERY_NAME_FIELD => 'query_name'; #################### # Simple Accessors # #################### +use Class::XSAccessor { + accessors => { + id => __PACKAGE__->ID_FIELD, + name => __PACKAGE__->QUERY_NAME_FIELD, + }, +}; + sub eventid { return $_[0]->{'eventid'}; } sub sortkey { return $_[0]->{'sortkey'}; } sub one_email_per_bug { return $_[0]->{'onemailperbug'}; } sub title { return $_[0]->{'title'}; } -sub name { return $_[0]->{'query_name'}; } 1; diff --git a/Bugzilla/Whine/Schedule.pm b/Bugzilla/Whine/Schedule.pm index 017b744e5..725920cd7 100644 --- a/Bugzilla/Whine/Schedule.pm +++ b/Bugzilla/Whine/Schedule.pm @@ -45,6 +45,13 @@ use constant LIST_ORDER => 'id'; #################### # Simple Accessors # #################### +use Class::XSAccessor { + accessors => { + id => __PACKAGE__->ID_FIELD, + name => __PACKAGE__->NAME_FIELD, + }, +}; + sub eventid { return $_[0]->{'eventid'}; } sub run_day { return $_[0]->{'run_day'}; } sub run_time { return $_[0]->{'run_time'}; } |