Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ed3e8fa8

Von Sven Schöling vor mehr als 6 Jahren hinzugefügt

  • ID ed3e8fa81e0257f76beadcadc94da9aaa2a14641
  • Vorgänger d255a1f6
  • Nachfolger b2548946

CustomVariableConfigs: hotpath micro optimierungen

Unterschiede anzeigen:

SL/DB/CustomVariableConfig.pm
44 44
sub processed_options {
45 45
  my ($self) = @_;
46 46

  
47
  if( exists($self->{processed_options_cache}) ) {
48
    return $self->{processed_options_cache};
49
  }
47
  return $self->{processed_options_cache} if $self->{processed_options_cache};
50 48

  
51 49
  my $ops = $self->options;
52 50
  my $ret;
......
70 68
sub processed_flags {
71 69
  my ($self) = @_;
72 70

  
73
  if( exists($self->{processed_flags_cache}) ) {
74
    return $self->{processed_flags_cache};
75
  }
71
  return $self->{processed_flags_cache} if $self->{processed_flags_cache};
76 72

  
77 73
  my $flags = $self->flags;
78 74
  my $ret = {};
......
91 87
}
92 88

  
93 89
sub has_flag {
94
  my ($self, $flag) = @_;
95

  
96
  return $self->processed_flags()->{$flag};
90
  $_[0]->processed_flags->{$_[1]};
97 91
}
98 92

  
99 93
sub type_dependent_default_value {
......
103 97
  return (any { $_ eq $self->default_value } @{ $self->processed_options }) ? $self->default_value : $self->processed_options->[0];
104 98
}
105 99

  
100
sub textarea_options {
101
  my $options = $_[0]->processed_options;
102

  
103
  cols => $options->{WIDTH},
104
  rows => $options->{HEIGHT}
105
}
106

  
107
sub text_options {
108
  maxlength => $_[0]->processed_options->{MAXLENGTH}
109
}
110

  
111
sub number_options {
112
  precision => $_[0]->processed_options->{PRECISION}
113
}
114

  
106 115
sub value_col {
107 116
  my ($self) = @_;
108 117

  

Auch abrufbar als: Unified diff