[subset] Use hb_clamp instead of consequent hb_min and hb_max calls

As just a minor code tweak to clarify the intention better.
pull/4800/head
Ebrahim Byagowi 8 months ago committed by Behdad Esfahbod
parent e079dd2030
commit 495937f96d
  1. 2
      src/graph/graph.hh
  2. 2
      src/hb-subset-instancer-solver.cc

@ -368,7 +368,7 @@ struct graph_t
// it's parent where possible.
int64_t modified_distance =
hb_min (hb_max(distance + distance_modifier (), 0), 0x7FFFFFFFFFF);
hb_clamp (distance + distance_modifier (), 0, 0x7FFFFFFFFFF);
if (has_max_priority ()) {
modified_distance = 0;
}

@ -376,7 +376,7 @@ double renormalizeValue (double v, const Triple &triple,
assert (lower <= def && def <= upper);
if (!extrapolate)
v = hb_max (hb_min (v, upper), lower);
v = hb_clamp (v, lower, upper);
if (v == def)
return 0.0;

Loading…
Cancel
Save