equal
deleted
inserted
replaced
1071 size_t length = 0; |
1071 size_t length = 0; |
1072 // array length stored in first element, other elements offset by one |
1072 // array length stored in first element, other elements offset by one |
1073 if (indices == NULL || (length = (size_t)indices[0]) <= idnum) { |
1073 if (indices == NULL || (length = (size_t)indices[0]) <= idnum) { |
1074 size_t size = MAX2(idnum+1, (size_t)idnum_allocated_count()); |
1074 size_t size = MAX2(idnum+1, (size_t)idnum_allocated_count()); |
1075 int* new_indices = NEW_C_HEAP_ARRAY(int, size+1); |
1075 int* new_indices = NEW_C_HEAP_ARRAY(int, size+1); |
|
1076 new_indices[0] =(int)size; // array size held in the first element |
1076 // Copy the existing entries, if any |
1077 // Copy the existing entries, if any |
1077 size_t i; |
1078 size_t i; |
1078 for (i = 0; i < length; i++) { |
1079 for (i = 0; i < length; i++) { |
1079 new_indices[i+1] = indices[i+1]; |
1080 new_indices[i+1] = indices[i+1]; |
1080 } |
1081 } |