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/Whine/Query.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Whine/Query.pm') 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; -- cgit v1.2.3-24-g4f1b