** returns the `main' position of an element in a table (that is, the index ** of its hash value) */
| 9338 | ** of its hash value) |
| 9339 | */ |
| 9340 | static Node *mainposition (const Table *t, const TValue *key) { |
| 9341 | switch (ttype(key)) { |
| 9342 | case LUA_TNUMBER: |
| 9343 | return hashnum(t, nvalue(key)); |
| 9344 | case LUA_TSTRING: |
| 9345 | return hashstr(t, rawtsvalue(key)); |
| 9346 | case LUA_TBOOLEAN: |
| 9347 | return hashboolean(t, bvalue(key)); |
| 9348 | case LUA_TLIGHTUSERDATA: |
| 9349 | return hashpointer(t, pvalue(key)); |
| 9350 | default: |
| 9351 | return hashpointer(t, gcvalue(key)); |
| 9352 | } |
| 9353 | } |
| 9354 | |
| 9355 | |
| 9356 | /* |
no test coverage detected