~ubuntu-bugs-auftrags-killer/bugzilla-traceparser/bugzilla-traceparser

« back to all changes in this revision

Viewing changes to lib/TraceParser/Trace.pm

  • Committer: Max Kanat-Alexander
  • Date: 2009-08-06 06:16:59 UTC
  • Revision ID: mkanat@everythingsolved.com-20090806061659-6ro00pgmqdkyvdgc
Make loading of trace_text lazy, to speed up loading of trace.html.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    short_hash
41
41
    stack_hash
42
42
    trace_hash
43
 
    trace_text
44
43
    type
45
44
    quality
46
45
);
191
190
sub stack_hash  { return $_[0]->{stack_hash};  }
192
191
sub short_hash  { return $_[0]->{short_hash};  }
193
192
sub trace_hash  { return $_[0]->{trace_hash};  }
194
 
sub text        { return $_[0]->{trace_text};  }
195
193
sub type        { return $_[0]->{type};        }
196
194
sub quality     {
197
195
    my $self = shift;
198
196
    return sprintf('%.1f', $self->{quality});
199
197
}
200
198
 
 
199
sub text {
 
200
    my $self = shift;
 
201
    $self->{text} ||= Bugzilla->dbh->selectrow_array(
 
202
        'SELECT trace_text FROM trace WHERE id = ?',
 
203
        undef, $self->id);
 
204
    return $self->{text};
 
205
}
 
206
 
201
207
sub bug {
202
208
    my $self = shift;
203
209
    return $self->{bug} if exists $self->{bug};