/[Frey]/trunk/lib/Frey/CouchAPI.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/CouchAPI.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1061 by dpavlin, Fri Apr 24 21:51:03 2009 UTC revision 1062 by dpavlin, Mon Apr 27 16:23:52 2009 UTC
# Line 198  L<http://wiki.apache.org/couchdb/HTTP_Do Line 198  L<http://wiki.apache.org/couchdb/HTTP_Do
198                          my $by = $1;                          my $by = $1;
199                          my $offset = 0;                          my $offset = 0;
200                          my $startkey = delete $arg->{startkey};                          my $startkey = delete $arg->{startkey};
201                               $startkey ||= delete $arg->{startkey_docid}; # XXX key == id
202                          my $endkey   = delete $arg->{endkey};                          my $endkey   = delete $arg->{endkey};
203                          my $limit    = delete $arg->{limit};                          my $limit    = delete $arg->{limit};
204                          my $skip     = delete $arg->{skip};                          my $skip     = delete $arg->{skip};
205                          my $total_rows = 0;                          my $total_rows = 0;
206                            my $collected_rows = 0;
207    
208                          my @docs = grep { length $_ } map {                          my @docs = grep { length $_ } map {
209    
210                                  if ( $limit > 0 && $total_rows == $limit ) {                                  $total_rows++;
211            
212                                    if ( $limit > 0 && $collected_rows == $limit ) {
213                                          '';                                          '';
214                                  } else {                                  } else {
215                    
# Line 215  L<http://wiki.apache.org/couchdb/HTTP_Do Line 219  L<http://wiki.apache.org/couchdb/HTTP_Do
219                                                  '';                                                  '';
220                                          } elsif ( $startkey ) {                                          } elsif ( $startkey ) {
221                                                  if ( $_ ge $startkey ) {                                                  if ( $_ ge $startkey ) {
222                                                          $total_rows++;                                                          $collected_rows++;
223                                                          $_;                                                          $_;
224                                                  } else {                                                  } else {
225                                                          $offset++;                                                          $offset++;
226                                                          '';                                                          '';
227                                                  }                                                  }
228                                          } else {                                          } else {
229                                                  $total_rows++;                                                  $collected_rows++;
230                                                  $_;                                                  $_;
231                                          }                                          }
232                                  }                                  }

Legend:
Removed from v.1061  
changed lines
  Added in v.1062

  ViewVC Help
Powered by ViewVC 1.1.26