Mercurial > pub > Impl
diff Lib/IMPL/Object/List.pm @ 194:4d0e1962161c
Replaced tabs with spaces
IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author | cin |
---|---|
date | Tue, 10 Apr 2012 20:08:29 +0400 |
parents | 6148f89bb7bf |
children | 4ddb27ff4a0b |
line wrap: on
line diff
--- a/Lib/IMPL/Object/List.pm Tue Apr 10 08:13:22 2012 +0400 +++ b/Lib/IMPL/Object/List.pm Tue Apr 10 20:08:29 2012 +0400 @@ -43,7 +43,7 @@ } sub Item { - return $_[0]->[$_[1]]; + return $_[0]->[$_[1]]; } sub InsertAt { @@ -77,41 +77,41 @@ } sub FindItem { - my ($this,$item) = @_; - - for (my $i = 0; $i < @$this; $i++ ) { - return $i if $this->[$i] == $item - } - return undef; + my ($this,$item) = @_; + + for (my $i = 0; $i < @$this; $i++ ) { + return $i if $this->[$i] == $item + } + return undef; } sub FindItemStr { - my ($this,$item) = @_; - - for (my $i = 0; $i < @$this; $i++ ) { - return $i if $this->[$i] eq $item - } - return undef; + my ($this,$item) = @_; + + for (my $i = 0; $i < @$this; $i++ ) { + return $i if $this->[$i] eq $item + } + return undef; } sub save { - my ($this,$ctx) = @_; - - $ctx->AddVar( item => $_ ) foreach @$this; + my ($this,$ctx) = @_; + + $ctx->AddVar( item => $_ ) foreach @$this; } sub restore { - my ($class,$data,$surrogate) = @_; - - my $i = 0; - - if ($surrogate) { - @$surrogate = grep { ($i++)%2 } @$data; - } else { - $surrogate = $class->new([grep { ($i++)%2 } @$data]); - } - - return $surrogate; + my ($class,$data,$surrogate) = @_; + + my $i = 0; + + if ($surrogate) { + @$surrogate = grep { ($i++)%2 } @$data; + } else { + $surrogate = $class->new([grep { ($i++)%2 } @$data]); + } + + return $surrogate; } 1;