Patch #26130

Refactor "multiple_values_detail" struct creation

Added by Thomas Löber 6 months ago. Updated 5 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Code cleanup/refactoring
Target version:4.0.0

Description

Hi,

In the IssuesHelper#details_to_strings method (source:trunk/app/helpers/issues_helper.rb@16387#L373) a new class (Struct) is created each time the method is called:

  multiple_values_detail = Struct.new(:property, :prop_key, :custom_field, :old_value, :value)

Although classes are garbage collected in recent Ruby versions, it might be better to use a constant definition outside the method, like:

  MultipleValuesDetail = Struct.new(:property, :prop_key, :custom_field, :old_value, :value)

Regards,
Thomas

Associated revisions

Revision 16707
Added by Jean-Philippe Lang 6 months ago

Refactor "multiple_values_detail" struct creation (#26130).

History

#1 Updated by Go MAEDA 6 months ago

  • Category changed from Performance to Code cleanup/refactoring

#2 Updated by Go MAEDA 6 months ago

  • Description updated (diff)

#3 Updated by Jean-Philippe Lang 6 months ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 4.0.0

Change committed, thanks.

#4 Updated by Toshi MARUYAMA 6 months ago

  • Description updated (diff)

#5 Updated by Toshi MARUYAMA 6 months ago

  • Target version changed from 4.0.0 to 4.1.0

I think target version should be version:3.5.0 because there is no 3.5-stable in Subversion.

#6 Updated by Jean-Philippe Lang 5 months ago

  • Target version changed from 4.1.0 to 4.0.0

Also available in: Atom PDF