✨ id_query_naive
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,4 +3,5 @@ planet-latest_geonames.tsv
|
|||||||
|
|
||||||
*.o
|
*.o
|
||||||
|
|
||||||
*/.vscode
|
*/.vscode/
|
||||||
|
.vscode/
|
Binary file not shown.
@ -27,7 +27,14 @@ void free_naive(struct naive_data* 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) {
|
||||||
return &data->rs[needle];
|
int n = data->n;
|
||||||
|
for (int i = 0 ; i < n ; i++) {
|
||||||
|
struct record *rec = &data->rs[i];
|
||||||
|
if (rec->osm_id == needle) {
|
||||||
|
return rec;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
|
Reference in New Issue
Block a user