https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32060

--- Comment #11 from David Gustafsson <[email protected]> ---
This actually speeds speeds up so that calling the property method directly is
as fast as$self->_result()->get_column($column)

   if ( grep { $_ eq $method } @columns ) {
        #    if ( @_ ) {
        #       $self->_result()->set_column( $method, @_);
        #       return $self;
        #} else {
        #               my $value = $self->_result()->get_column( $method );
        #       return $value;
        #}
        no strict 'refs';
        *{$AUTOLOAD} = sub {
                my $self = shift;
                if ( @_ ) {
                    $self->_result()->set_column( $method, @_);
                    return $self;
                } else {
                    my $value = $self->_result()->get_column( $method );
                    return $value;
                }
        };
This lazily defined new methods in the symbol table, and next time that method
will be called instead of AUTOLOAD. Will have a look at creating another bug
for this change.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to