@@ -371,7 +371,7 @@ class open_addressing_ref_impl {
371371
372372 for (auto & slot_content : window_slots) {
373373 auto const eq_res =
374- this ->predicate_ .operator ()<is_insert::YES>(this ->extract_key (slot_content), key );
374+ this ->predicate_ .operator ()<is_insert::YES>(key, this ->extract_key (slot_content));
375375
376376 if constexpr (not allows_duplicates) {
377377 // If the key is already in the container, return false
@@ -422,7 +422,7 @@ class open_addressing_ref_impl {
422422 auto const [state, intra_window_index] = [&]() {
423423 for (auto i = 0 ; i < window_size; ++i) {
424424 switch (
425- this ->predicate_ .operator ()<is_insert::YES>(this ->extract_key (window_slots[i]), key )) {
425+ this ->predicate_ .operator ()<is_insert::YES>(key, this ->extract_key (window_slots[i]))) {
426426 case detail::equal_result::AVAILABLE:
427427 return window_probing_results{detail::equal_result::AVAILABLE, i};
428428 case detail::equal_result::EQUAL: {
@@ -506,7 +506,7 @@ class open_addressing_ref_impl {
506506
507507 for (auto i = 0 ; i < window_size; ++i) {
508508 auto const eq_res =
509- this ->predicate_ .operator ()<is_insert::YES>(this ->extract_key (window_slots[i]), key );
509+ this ->predicate_ .operator ()<is_insert::YES>(key, this ->extract_key (window_slots[i]));
510510 auto * window_ptr = (storage_ref_.data () + *probing_iter)->data ();
511511
512512 // If the key is already in the container, return false
@@ -579,7 +579,7 @@ class open_addressing_ref_impl {
579579 auto res = detail::equal_result::UNEQUAL;
580580 for (auto i = 0 ; i < window_size; ++i) {
581581 res =
582- this ->predicate_ .operator ()<is_insert::YES>(this ->extract_key (window_slots[i]), key );
582+ this ->predicate_ .operator ()<is_insert::YES>(key, this ->extract_key (window_slots[i]));
583583 if (res != detail::equal_result::UNEQUAL) { return window_probing_results{res, i}; }
584584 }
585585 // returns dummy index `-1` for UNEQUAL
@@ -662,7 +662,7 @@ class open_addressing_ref_impl {
662662
663663 for (auto & slot_content : window_slots) {
664664 auto const eq_res =
665- this ->predicate_ .operator ()<is_insert::NO>(this ->extract_key (slot_content), key );
665+ this ->predicate_ .operator ()<is_insert::NO>(key, this ->extract_key (slot_content));
666666
667667 // Key doesn't exist, return false
668668 if (eq_res == detail::equal_result::EMPTY) { return false ; }
@@ -704,7 +704,7 @@ class open_addressing_ref_impl {
704704 auto const [state, intra_window_index] = [&]() {
705705 auto res = detail::equal_result::UNEQUAL;
706706 for (auto i = 0 ; i < window_size; ++i) {
707- res = this ->predicate_ .operator ()<is_insert::NO>(this ->extract_key (window_slots[i]), key );
707+ res = this ->predicate_ .operator ()<is_insert::NO>(key, this ->extract_key (window_slots[i]));
708708 if (res != detail::equal_result::UNEQUAL) { return window_probing_results{res, i}; }
709709 }
710710 // returns dummy index `-1` for UNEQUAL
@@ -758,7 +758,7 @@ class open_addressing_ref_impl {
758758 auto const window_slots = storage_ref_[*probing_iter];
759759
760760 for (auto & slot_content : window_slots) {
761- switch (this ->predicate_ .operator ()<is_insert::NO>(this ->extract_key (slot_content), key )) {
761+ switch (this ->predicate_ .operator ()<is_insert::NO>(key, this ->extract_key (slot_content))) {
762762 case detail::equal_result::UNEQUAL: continue ;
763763 case detail::equal_result::EMPTY: return false ;
764764 case detail::equal_result::EQUAL: return true ;
@@ -793,7 +793,7 @@ class open_addressing_ref_impl {
793793 auto const state = [&]() {
794794 auto res = detail::equal_result::UNEQUAL;
795795 for (auto & slot : window_slots) {
796- res = this ->predicate_ .operator ()<is_insert::NO>(this ->extract_key (slot), key );
796+ res = this ->predicate_ .operator ()<is_insert::NO>(key, this ->extract_key (slot));
797797 if (res != detail::equal_result::UNEQUAL) { return res; }
798798 }
799799 return res;
@@ -830,7 +830,7 @@ class open_addressing_ref_impl {
830830
831831 for (auto i = 0 ; i < window_size; ++i) {
832832 switch (
833- this ->predicate_ .operator ()<is_insert::NO>(this ->extract_key (window_slots[i]), key )) {
833+ this ->predicate_ .operator ()<is_insert::NO>(key, this ->extract_key (window_slots[i]))) {
834834 case detail::equal_result::EMPTY: {
835835 return this ->end ();
836836 }
@@ -869,7 +869,7 @@ class open_addressing_ref_impl {
869869 auto const [state, intra_window_index] = [&]() {
870870 auto res = detail::equal_result::UNEQUAL;
871871 for (auto i = 0 ; i < window_size; ++i) {
872- res = this ->predicate_ .operator ()<is_insert::NO>(this ->extract_key (window_slots[i]), key );
872+ res = this ->predicate_ .operator ()<is_insert::NO>(key, this ->extract_key (window_slots[i]));
873873 if (res != detail::equal_result::UNEQUAL) { return window_probing_results{res, i}; }
874874 }
875875 // returns dummy index `-1` for UNEQUAL
@@ -1097,7 +1097,7 @@ class open_addressing_ref_impl {
10971097 if (cuco::detail::bitwise_compare (this ->extract_key (*old_ptr), this ->extract_key (expected))) {
10981098 return insert_result::SUCCESS;
10991099 } else {
1100- return this ->predicate_ .equal_to (this ->extract_key (*old_ptr ), this ->extract_key (desired )) ==
1100+ return this ->predicate_ .equal_to (this ->extract_key (desired ), this ->extract_key (*old_ptr )) ==
11011101 detail::equal_result::EQUAL
11021102 ? insert_result::DUPLICATE
11031103 : insert_result::CONTINUE;
@@ -1144,7 +1144,7 @@ class open_addressing_ref_impl {
11441144
11451145 // Our key was already present in the slot, so our key is a duplicate
11461146 // Shouldn't use `predicate` operator directly since it includes a redundant bitwise compare
1147- if (this ->predicate_ .equal_to (*old_key_ptr, desired.first ) == detail::equal_result::EQUAL) {
1147+ if (this ->predicate_ .equal_to (desired.first , *old_key_ptr ) == detail::equal_result::EQUAL) {
11481148 return insert_result::DUPLICATE;
11491149 }
11501150
@@ -1183,7 +1183,7 @@ class open_addressing_ref_impl {
11831183
11841184 // Our key was already present in the slot, so our key is a duplicate
11851185 // Shouldn't use `predicate` operator directly since it includes a redundant bitwise compare
1186- if (this ->predicate_ .equal_to (*old_key_ptr, desired.first ) == detail::equal_result::EQUAL) {
1186+ if (this ->predicate_ .equal_to (desired.first , *old_key_ptr ) == detail::equal_result::EQUAL) {
11871187 return insert_result::DUPLICATE;
11881188 }
11891189
0 commit comments