We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 646e21c commit ee6ceb6Copy full SHA for ee6ceb6
inst/include/Rcpp/hash/IndexHash.h
@@ -159,20 +159,25 @@ namespace Rcpp{
159
#endif
160
}
161
162
+ inline bool not_equal(STORAGE lhs, STORAGE rhs) {
163
+ return ::Rcpp::traits::comparator_type<STORAGE>()(lhs, rhs);
164
+ }
165
166
bool add_value(int i){
167
RCPP_DEBUG_2( "%s::add_value(%d)", DEMANGLE(IndexHash), i )
168
STORAGE val = src[i++] ;
169
int addr = get_addr(val) ;
- while (data[addr] && src[data[addr] - 1] != val) {
170
+ while (data[addr] && not_equal( src[data[addr] - 1], val)) {
171
addr++;
172
if (addr == m) addr = 0;
173
174
if (!data[addr]){
175
data[addr] = i ;
176
size_++ ;
177
+
178
return true ;
179
180
181
return false;
182
183
0 commit comments