summaryrefslogtreecommitdiffstats
path: root/extensions/TrackingFlags/lib/Flag
diff options
context:
space:
mode:
authorUpasana <upasana-me@users.noreply.github.com>2018-03-05 00:58:41 +0100
committerDylan William Hardison <dylan@hardison.net>2018-03-05 00:58:41 +0100
commited53ecda0546d6c639fa3d227a59ace4d57b81a5 (patch)
treee716548b5b3b6129396bb559ab2acb32fcfad09d /extensions/TrackingFlags/lib/Flag
parent456dd5df6dfc799d72d446541ce5da147917db6e (diff)
downloadbugzilla-ed53ecda0546d6c639fa3d227a59ace4d57b81a5.tar.gz
bugzilla-ed53ecda0546d6c639fa3d227a59ace4d57b81a5.tar.xz
Bug 1273381 - Improve bugzilla object performance by using Class::XSAccessor for object accessors
Diffstat (limited to 'extensions/TrackingFlags/lib/Flag')
-rw-r--r--extensions/TrackingFlags/lib/Flag/Bug.pm7
-rw-r--r--extensions/TrackingFlags/lib/Flag/Value.pm9
-rw-r--r--extensions/TrackingFlags/lib/Flag/Visibility.pm7
3 files changed, 22 insertions, 1 deletions
diff --git a/extensions/TrackingFlags/lib/Flag/Bug.pm b/extensions/TrackingFlags/lib/Flag/Bug.pm
index 7be661720..62f103ee5 100644
--- a/extensions/TrackingFlags/lib/Flag/Bug.pm
+++ b/extensions/TrackingFlags/lib/Flag/Bug.pm
@@ -169,6 +169,13 @@ sub set_value { $_[0]->set('value', $_[1]); }
#### Accessors ####
###############################
+use Class::XSAccessor {
+ accessors => {
+ id => __PACKAGE__->ID_FIELD,
+ name => __PACKAGE__->NAME_FIELD,
+ },
+};
+
sub tracking_flag_id { return $_[0]->{'tracking_flag_id'}; }
sub bug_id { return $_[0]->{'bug_id'}; }
sub value { return $_[0]->{'value'}; }
diff --git a/extensions/TrackingFlags/lib/Flag/Value.pm b/extensions/TrackingFlags/lib/Flag/Value.pm
index 4f2aacc3a..c1b3ef4f1 100644
--- a/extensions/TrackingFlags/lib/Flag/Value.pm
+++ b/extensions/TrackingFlags/lib/Flag/Value.pm
@@ -35,6 +35,7 @@ use constant DB_COLUMNS => qw(
);
use constant LIST_ORDER => 'sortkey';
+use constant NAME_FIELD => 'value';
use constant UPDATE_COLUMNS => qw(
setter_group_id
@@ -111,6 +112,13 @@ sub set_comment { $_[0]->set('comment', $_[1]); }
#### Accessors ####
###############################
+use Class::XSAccessor {
+ accessors => {
+ id => __PACKAGE__->ID_FIELD,
+ name => __PACKAGE__->NAME_FIELD,
+ },
+};
+
sub tracking_flag_id { return $_[0]->{'tracking_flag_id'}; }
sub setter_group_id { return $_[0]->{'setter_group_id'}; }
sub value { return $_[0]->{'value'}; }
@@ -140,7 +148,6 @@ sub setter_group {
## Compatibility with Bugzilla::Field ##
########################################
-sub name { return $_[0]->{'value'}; }
sub is_visible_on_bug { return 1; }
1;
diff --git a/extensions/TrackingFlags/lib/Flag/Visibility.pm b/extensions/TrackingFlags/lib/Flag/Visibility.pm
index 878c16f99..a16ddfe75 100644
--- a/extensions/TrackingFlags/lib/Flag/Visibility.pm
+++ b/extensions/TrackingFlags/lib/Flag/Visibility.pm
@@ -147,6 +147,13 @@ sub _check_component {
#### Accessors ####
###############################
+use Class::XSAccessor {
+ accessors => {
+ id => __PACKAGE__->ID_FIELD,
+ name => __PACKAGE__->NAME_FIELD,
+ },
+};
+
sub tracking_flag_id { return $_[0]->{'tracking_flag_id'}; }
sub product_id { return $_[0]->{'product_id'}; }
sub component_id { return $_[0]->{'component_id'}; }