From 780bf9be6410bec5778077a8afadc2e53c8e7db7 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Mon, 19 Oct 2026 15:42:02 +0000 Subject: [PATCH] Use const& intsead of copy in for loops. --- ift/table_keyed_diff.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ift/table_keyed_diff.cc b/ift/table_keyed_diff.cc index 623da0cc..dd4fd39f 100644 --- a/ift/table_keyed_diff.cc +++ b/ift/table_keyed_diff.cc @@ -33,7 +33,7 @@ Status TableKeyedDiff::Diff(const FontData& font_base, flat_hash_set new_tables; flat_hash_set unchanged_tables; - for (std::string tag : diff_tags) { + for (const std::string& tag : diff_tags) { hb_tag_t t = HB_TAG(tag[0], tag[1], tag[2], tag[3]); bool in_base = base_tags.contains(t); bool in_derived = derived_tags.contains(t); @@ -99,7 +99,7 @@ Status TableKeyedDiff::Diff(const FontData& font_base, // Skip past all of the offsets (there's patchesCount + 1 of them) uint32_t current_offset = data.size() + (diff_tags.size() + 1) * 4; - for (std::string tag : diff_tags) { + for (const std::string& tag : diff_tags) { FontHelper::WriteUInt32(current_offset, data); uint32_t min_size = 9; current_offset += min_size; @@ -112,7 +112,7 @@ Status TableKeyedDiff::Diff(const FontData& font_base, FontHelper::WriteUInt32(current_offset, data); // Write out table patches - for (std::string tag : diff_tags) { + for (const std::string& tag : diff_tags) { hb_tag_t t = HB_TAG(tag[0], tag[1], tag[2], tag[3]); FontHelper::WriteUInt32(t, data);