Insert a single value into a hash. Does not tell whether the value was inserted -- if an identical value existed, it is not replaced. @retval TRUE Out of memory. @retval FALSE OK. The value either was inserted or existed in the hash. */
| 55 | in the hash. |
| 56 | */ |
| 57 | bool insert(T *value) |
| 58 | { |
| 59 | my_hash_init_opt(&m_hash, &my_charset_bin, START_SIZE, 0, 0, K, 0, MYF(0)); |
| 60 | size_t key_len; |
| 61 | const uchar *key= K(reinterpret_cast<uchar*>(value), &key_len, FALSE); |
| 62 | if (my_hash_search(&m_hash, key, key_len) == NULL) |
| 63 | return my_hash_insert(&m_hash, reinterpret_cast<uchar *>(value)); |
| 64 | return FALSE; |
| 65 | } |
| 66 | /** Is this hash set empty? */ |
| 67 | bool is_empty() const { return m_hash.records == 0; } |
| 68 | /** Returns the number of unique elements. */ |
nothing calls this directly
no test coverage detected