Use LayerList::get_paint() instead of std::addressof

Replace manual pointer arithmetic with std::addressof with the
cleaner get_paint() method that LayerList provides.

Changes:
- colrv1-depend.hh: Use paint_offset_lists.get_paint(i)
- colrv1-closure.hh: Use paint_offset_lists.get_paint(i)

Both files now use the same clean pattern: get_paint() encapsulates
the offset arithmetic (this+(*this)[i]) in a single method call.
This commit is contained in:
Skef Iterum committed 2026-02-05 23:32:21 -08:00
1 parent 5b45fa0f50
commit 72181fa7c0
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@ HB_INTERNAL void PaintColrLayers::closurev1 (hb_colrv1_closure_context_t* c) con
const LayerList &paint_offset_lists = c->get_colr_table ()->get_layerList ();
for (unsigned i = firstLayerIndex; i < firstLayerIndex + numLayers; i++)
{
const Paint &paint = std::addressof (paint_offset_lists) + paint_offset_lists[i];
const Paint &paint = paint_offset_lists.get_paint (i);
paint.dispatch (c);
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ HB_INTERNAL void PaintColrLayers::dependv1 (hb_colrv1_depend_context_t* c) const
const LayerList &paint_offset_lists = c->get_colr_table ()->get_layerList ();
for (unsigned i = firstLayerIndex; i < firstLayerIndex + numLayers; i++)
{
const Paint &paint = std::addressof (paint_offset_lists) + paint_offset_lists[i];
const Paint &paint = paint_offset_lists.get_paint (i);
paint.dispatch (c);
}
}