| 243 | } |
| 244 | |
| 245 | void cnt_dist(const int32_t *dist_array, const int64_t array_size, |
| 246 | GHashTable *hash_table) { |
| 247 | for (int64_t i = 0; i < array_size; i++) { |
| 248 | int64_t dist = dist_array[i] == -1 ? INT64_MAX : dist_array[i]; |
| 249 | gpointer gp_dist = GSIZE_TO_POINTER((gsize)dist); |
| 250 | int64_t old_cnt = (int64_t)g_hash_table_lookup(hash_table, gp_dist); |
| 251 | g_hash_table_replace(hash_table, gp_dist, GSIZE_TO_POINTER(old_cnt + 1)); |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | void _write_dist_cnt(gpointer k, gpointer v, gpointer user_data) { |
| 256 | int64_t dist = (int64_t)GPOINTER_TO_SIZE(k); |
no outgoing calls
no test coverage detected