From 72181fa7c06685e9fd56b2f03ea03f5469b44ce3 Mon Sep 17 00:00:00 2001 From: Skef Iterum Date: Thu, 5 Feb 2026 23:32:21 -0800 Subject: [PATCH] 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. --- src/OT/Color/COLR/colrv1-closure.hh | 2 +- src/OT/Color/COLR/colrv1-depend.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OT/Color/COLR/colrv1-closure.hh b/src/OT/Color/COLR/colrv1-closure.hh index 9ed0aa563..292692104 100644 --- a/src/OT/Color/COLR/colrv1-closure.hh +++ b/src/OT/Color/COLR/colrv1-closure.hh @@ -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); } } diff --git a/src/OT/Color/COLR/colrv1-depend.hh b/src/OT/Color/COLR/colrv1-depend.hh index f9c8fc550..696bbf15e 100644 --- a/src/OT/Color/COLR/colrv1-depend.hh +++ b/src/OT/Color/COLR/colrv1-depend.hh @@ -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); } }