diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-11-01 15:39:29 -0500 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-11-01 15:39:29 -0500 |
| commit | 9ff37ba139dceb722af3502816ed228c43fbecfd (patch) | |
| tree | 7bca7bf7a98858a9f4bad4b3d8f0d3febf50fe4c /include/kpl/identifier.h | |
| parent | 9a61168aec3373be702bdbf252043ce3605f2b5b (diff) | |
inc and dec priority with io uring submit
Diffstat (limited to 'include/kpl/identifier.h')
| -rw-r--r-- | include/kpl/identifier.h | 13 |
1 files changed, 13 insertions, 0 deletions
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; +} |
