From ed53ecda0546d6c639fa3d227a59ace4d57b81a5 Mon Sep 17 00:00:00 2001 From: Upasana Date: Mon, 5 Mar 2018 00:58:41 +0100 Subject: Bug 1273381 - Improve bugzilla object performance by using Class::XSAccessor for object accessors --- Bugzilla/Comment/TagWeights.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Comment') diff --git a/Bugzilla/Comment/TagWeights.pm b/Bugzilla/Comment/TagWeights.pm index 4919244ce..ba7bdfc5b 100644 --- a/Bugzilla/Comment/TagWeights.pm +++ b/Bugzilla/Comment/TagWeights.pm @@ -39,7 +39,18 @@ use constant VALIDATORS => { }; # There's no gain to caching these objects use constant USE_MEMCACHED => 0; -sub tag { return $_[0]->{'tag'} } +############################### +#### Accessors ###### +############################### + +use Class::XSAccessor { + accessors => { + id => __PACKAGE__->ID_FIELD, + tag => __PACKAGE__->NAME_FIELD, + name => __PACKAGE__->NAME_FIELD, + }, +}; + sub weight { return $_[0]->{'weight'} } sub set_weight { $_[0]->set('weight', $_[1]); } -- cgit v1.2.3-24-g4f1b