+ HashVector *hv = &r->content;
+ void *key = query;
+ TupleSchema *type = (TupleSchema *) hv->type;
+ for ( ; (*index) < hv->table.size; (*index)++ ) {
+ void *old = HashVector_next( hv, index );
+ if ( old ) {
+ if ( key && type->base.haskey( type, old, key ) == 0 ) {
+ continue;
+ }
+ return old;
+ }
+ }
+ (*index) = hv->table.size;
+ return 0;