** Hash for integers. To allow a good hash, use the remainder operator ** ('%'). If integer fits as a non-negative int, compute an int ** remainder, which is faster. Otherwise, use an unsigned-integer ** remainder, which uses all bits and ensures a non-negative result. */
| 106 | ** remainder, which uses all bits and ensures a non-negative result. |
| 107 | */ |
| 108 | static Node *hashint (const Table *t, lua_Integer i) { |
| 109 | lua_Unsigned ui = l_castS2U(i); |
| 110 | if (ui <= cast_uint(INT_MAX)) |
| 111 | return hashmod(t, cast_int(ui)); |
| 112 | else |
| 113 | return hashmod(t, ui); |
| 114 | } |
| 115 | |
| 116 | |
| 117 | /* |
no outgoing calls
no test coverage detected