🐛
This commit is contained in:
@ -33,6 +33,9 @@ int id_query_loop(int argc, char** argv, mk_index_fn mk_index, free_index_fn fre
|
|||||||
|
|
||||||
uint64_t runtime_sum = 0;
|
uint64_t runtime_sum = 0;
|
||||||
while (getline(&line, &line_len, stdin) != -1) {
|
while (getline(&line, &line_len, stdin) != -1) {
|
||||||
|
if (line[0] == '\n') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
int64_t needle = atol(line);
|
int64_t needle = atol(line);
|
||||||
|
|
||||||
start = microseconds();
|
start = microseconds();
|
||||||
|
Binary file not shown.
@ -33,13 +33,7 @@ struct indexed_data* mk_indexed(struct record* rs, int n) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void free_indexed(struct indexed_data* data) {
|
void free_indexed(struct indexed_data* data) {
|
||||||
struct record* rs = malloc(sizeof(struct record*));
|
free(data);
|
||||||
int n = data->n;
|
|
||||||
for (int i = 0 ; i < n ; i++) {
|
|
||||||
struct index_record* irec = &data->irs[i];
|
|
||||||
rs[i] = *irec->record;
|
|
||||||
}
|
|
||||||
free_records(rs, n);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct record* lookup_indexed(struct indexed_data *data, int64_t needle) {
|
const struct record* lookup_indexed(struct indexed_data *data, int64_t needle) {
|
||||||
|
Binary file not shown.
@ -23,7 +23,7 @@ struct naive_data* mk_naive(struct record* rs, int n) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void free_naive(struct naive_data* data) {
|
void free_naive(struct naive_data* data) {
|
||||||
free_records(data->rs,data->n);
|
free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct record* lookup_naive(struct naive_data *data, int64_t needle) {
|
const struct record* lookup_naive(struct naive_data *data, int64_t needle) {
|
||||||
|
Reference in New Issue
Block a user