MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / add_value_get_index

Method add_value_get_index

inst/include/Rcpp/hash/SelfHash.h:70–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 }
69
70 int add_value_get_index(int i){
71 STORAGE val = normalize(src[i++]);
72 unsigned int addr = get_addr(val) ;
73 while (data[addr] && not_equal( src[data[addr] - 1], val)) {
74 addr++;
75 if (addr == static_cast<unsigned int>(m)) addr = 0;
76 }
77 if (!data[addr]) {
78 data[addr] = i ;
79 indices[addr] = ++size_ ;
80 }
81 return indices[addr] ;
82 }
83
84 /* NOTE: we are returning a 1-based index ! */
85 unsigned int get_index(STORAGE value) const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected