- union value obs_value;
- struct freq **existing_fr;
- struct freq *fr = xmalloc(sizeof (*fr));
- fr->value = case_data (c, var);
-
- fr->count = dict_get_case_weight (dict, c, &warn);
-
- obs_value.f = trunc (fr->value->f);
-
- if ( obs_value.f < lo || obs_value.f > hi)
- {
- free (fr);
- case_unref (c);
- continue;
- }
-
- fr->value = &obs_value;
-
- existing_fr = (struct freq **) hsh_probe (freq_hash, fr);
-
- /* This must exist in the hash, because we previously populated it
- with zero counts */
- assert (*existing_fr);
-
- (*existing_fr)->count += fr->count;
- free (fr);
-
- case_unref (c);
+ struct freq_mutable fr;
+ fr.value.f = trunc (case_num (c, var));
+ if (fr.value.f >= lo && fr.value.f <= hi)
+ {
+ struct freq_mutable *existing_fr = hsh_force_find (freq_hash, &fr);
+ existing_fr->count += dict_get_case_weight (dict, c, &warn);
+ }