+/*
+ * If we reallocate the color-pair array, we have to adjust the fast-index.
+ */
+NCURSES_EXPORT(void)
+_nc_copy_pairs(SCREEN *sp, colorpair_t * target, colorpair_t * source, int length)
+{
+ int n;
+ for (n = 0; n < length; ++n) {
+ void *find = tfind(source + n, &sp->_ordered_pairs, compare_data);
+ if (find != 0) {
+ tdelete(source + n, &sp->_ordered_pairs, compare_data);
+ tsearch(target + n, &sp->_ordered_pairs, compare_data);
+ }
+ }
+}
+