[Rt-commit] r13628 - rt/branches/3.7-RTIR-RELENG/html/Elements

ruz at bestpractical.com ruz at bestpractical.com
Thu Jun 26 18:39:25 EDT 2008


Author: ruz
Date: Thu Jun 26 18:39:25 2008
New Revision: 13628

Modified:
   rt/branches/3.7-RTIR-RELENG/html/Elements/EditCustomFieldSelect

Log:
* HasEntry call is too slow, refactor it away.
  Improves page rendering from hundreds of seconds to several.

Modified: rt/branches/3.7-RTIR-RELENG/html/Elements/EditCustomFieldSelect
==============================================================================
--- rt/branches/3.7-RTIR-RELENG/html/Elements/EditCustomFieldSelect	(original)
+++ rt/branches/3.7-RTIR-RELENG/html/Elements/EditCustomFieldSelect	Thu Jun 26 18:39:25 2008
@@ -83,6 +83,11 @@
 
 <%METHOD options>
 % @Default = grep defined && length, @Default;
+% # $Values->HasEntry is too slow here
+% if ( !@Default && $Values ) {
+%     @Default = map $_->Content, @{$Values->ItemsArrayRef};
+% }
+% $_ = lc $_ foreach @Default;
 % my $selected;
 % my $CFVs = $CustomField->Values;
 % my @levels;
@@ -107,8 +112,7 @@
 %           push @levels, $level;
 %       }
         <option value="<% $name %>"
-%       if ( ( grep $_ eq $name, @Default )
-%            || ( $Values && $Values->HasEntry( $name ) ) )
+%       if ( grep $_ eq lc $name, @Default )
 %       {
 %           $$SelectedRef = 1;
             selected


More information about the Rt-commit mailing list