diff --git a/src/v/pandaproxy/schema_registry/store.h b/src/v/pandaproxy/schema_registry/store.h index 073e0f513f213..85203c293272b 100644 --- a/src/v/pandaproxy/schema_registry/store.h +++ b/src/v/pandaproxy/schema_registry/store.h @@ -398,8 +398,8 @@ class store { const subject& sub, schema_id id, include_deleted inc_del) const { auto sub_it = BOOST_OUTCOME_TRYX(get_subject_iter(sub, inc_del)); const auto& vs = sub_it->second.versions; - return std::any_of(vs.cbegin(), vs.cend(), [id](const auto& entry) { - return entry.id == id; + return absl::c_any_of(vs, [id, inc_del](const auto& entry) { + return entry.id == id && (inc_del || !entry.deleted); }); }