X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=lib%2Fiterator.c;h=0af151402b429d3fe95d9c92c42e9e07eb9436f5;hp=3dbe878846ab3699af938d2e3a98c202eca8d7b3;hb=48d5f76c4831624cb4332c7707c2615c2474284c;hpb=634d474be8d4262f5a3e549cdb6891de239f4fe4 diff --git a/lib/iterator.c b/lib/iterator.c index 3dbe8788..0af15140 100644 --- a/lib/iterator.c +++ b/lib/iterator.c @@ -110,8 +110,7 @@ static int seek_file_stream_by_timestamp(struct ctf_file_stream *cfs, for (i = 0; i < stream_pos->packet_index->len; i++) { index = &g_array_index(stream_pos->packet_index, struct packet_index, i); - if (index->timestamp_begin >= timestamp || - index->timestamp_end <= timestamp) + if (index->timestamp_end <= timestamp) continue; stream_pos->packet_seek(&stream_pos->parent, i, SEEK_SET); @@ -177,7 +176,7 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos) switch (iter_pos->type) { case BT_SEEK_RESTORE: if (!iter_pos->u.restore) - goto error_arg; + return -EINVAL; heap_free(iter->stream_heap); ret = heap_init(iter->stream_heap, 0, stream_compare); @@ -228,9 +227,6 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos) case BT_SEEK_TIME: tc = iter->ctx->tc; - if (!iter_pos->u.seek_time) - goto error_arg; - heap_free(iter->stream_heap); ret = heap_init(iter->stream_heap, 0, stream_compare); if (ret < 0) @@ -253,13 +249,11 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos) return 0; default: /* not implemented */ - goto error_arg; + return -EINVAL; } return 0; -error_arg: - ret = -EINVAL; error: heap_free(iter->stream_heap); if (heap_init(iter->stream_heap, 0, stream_compare) < 0) {