From 9ff37ba139dceb722af3502816ed228c43fbecfd Mon Sep 17 00:00:00 2001 From: nodist Date: Sun, 1 Nov 2026 15:39:29 -0500 Subject: inc and dec priority with io uring submit --- include/kpl/identifier.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/kpl/identifier.h') diff --git a/include/kpl/identifier.h b/include/kpl/identifier.h index a30b4a7..9bb42b0 100644 --- a/include/kpl/identifier.h +++ b/include/kpl/identifier.h @@ -43,3 +43,16 @@ void kpl_identifier_decode(kpl_identifier *identifier, char c_string[KPL_IDENTIF * 0 - equal, negative - left < right, positive - left > right */ int32_t kpl_identifier_compare(const kpl_identifier *identifier_left, const kpl_identifier *identifier_right); + +/* + * Check if two identifiers are equal + * Faster then comparing when equality check is needed + */ +inline bool kpl_identifier_equal(const kpl_identifier *identifier_a, const kpl_identifier *identifier_b) { + for (int32_t part_index = 0; part_index < KPL_IDENTIFIER_PARTS; part_index++) + if (!identifier_a->parts[part_index] && !identifier_b->parts[part_index]) + break; + else if (identifier_a->parts[part_index] != identifier_b->parts[part_index]) + return false; + return true; +} -- cgit v1.2.3