** Re-insert into the new hash part of a table the elements from the ** vanishing slice of the array part. */
| 674 | ** vanishing slice of the array part. |
| 675 | */ |
| 676 | static void reinsertOldSlice (Table *t, unsigned oldasize, |
| 677 | unsigned newasize) { |
| 678 | unsigned i; |
| 679 | for (i = newasize; i < oldasize; i++) { /* traverse vanishing slice */ |
| 680 | lu_byte tag = *getArrTag(t, i); |
| 681 | if (!tagisempty(tag)) { /* a non-empty entry? */ |
| 682 | TValue key, aux; |
| 683 | setivalue(&key, l_castU2S(i) + 1); /* make the key */ |
| 684 | farr2val(t, i, tag, &aux); /* copy value into 'aux' */ |
| 685 | insertkey(t, &key, &aux); /* insert entry into the hash part */ |
| 686 | } |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | |
| 691 | /* |
no test coverage detected