[freeside-commits] branch FREESIDE_3_BRANCH updated. 0e0109e17e7601dfcc655ff9b18a9846c0d93297

Ivan ivan at 420.am
Mon Jul 8 14:08:46 PDT 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  0e0109e17e7601dfcc655ff9b18a9846c0d93297 (commit)
      from  d4a404f4eda27d51301012cfb8bd5efd89213ce1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0e0109e17e7601dfcc655ff9b18a9846c0d93297
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jul 8 14:08:43 2013 -0700

    performance improvement for packages with many services, patch from jeff finucane, RT#23900

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 824221f..f97cf91 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2456,11 +2456,13 @@ sub _sort_cust_svc {
   my $sort =
     sub ($$) { my ($a, $b) = @_; $b->[1] cmp $a->[1]  or  $a->[2] <=> $b->[2] };
 
+  my %pkg_svc = map { $_->svcpart => $_ }
+                qsearch( 'pkg_svc', { 'pkgpart' => $self->pkgpart } );
+
   map  { $_->[0] }
   sort $sort
   map {
-        my $pkg_svc = qsearchs( 'pkg_svc', { 'pkgpart' => $self->pkgpart,
-                                             'svcpart' => $_->svcpart     } );
+        my $pkg_svc = $pkg_svc{ $_->svcpart } || '';
         [ $_,
           $pkg_svc ? $pkg_svc->primary_svc : '',
           $pkg_svc ? $pkg_svc->quantity : 0,

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_pkg.pm |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list