if (from > 0 && valtable[from] != null)
{
sym = valtable[from];
- for (i = from - 1; i >= 0 && valtable[i] == sym; i--)
- valtable[i] = null;
for (i = from; i < LENGTH && valtable[i] == sym; i++)
valtable[i] = null;
}
if (to < LENGTH && valtable[to] != null)
{
sym = valtable[to];
- for (i = to - 1; i >= 0 && valtable[i] == sym; i--)
- valtable[i] = null;
for (i = to; i < LENGTH && valtable[i] == sym; i++)
valtable[i] = null;
}
if (valtable[from2] != null)
{
sym = valtable[from2];
- for (i = from2 - 1; i >= 0 && valtable[i] == sym; i--)
- valtable[i] = null;
for (i = from2; i < LENGTH && valtable[i] == sym; i++)
valtable[i] = null;
}
sym = valtable[from - 1];
for (i = from - 1; i >= 0 && valtable[i] == sym; i--)
valtable[i] = null;
- for (i = from; i < LENGTH && valtable[i] == sym; i++)
- valtable[i] = null;
}
- if (to < LENGTH && valtable[to - 1] != null)
+ if (valtable[to - 1] != null)
{
sym = valtable[to - 1];
for (i = to - 1; i >= 0 && valtable[i] == sym; i--)
valtable[i] = null;
- for (i = to; i < LENGTH && valtable[i] == sym; i++)
- valtable[i] = null;
}
// copy
// delete
for (i = to; i < LENGTH; i++)
valtable[i - l] = valtable[i];
- for (i = LENGTH - l; i < LENGTH; i++)
- valtable[i] = null;
+ valtable[LENGTH - l] = null;
// sensitivity for insertion
if (from2 > 0 && valtable[from2 - 1] != null)
sym = valtable[from2 - 1];
for (i = from2 - 1; i >= 0 && valtable[i] == sym; i--)
valtable[i] = null;
- for (i = from2; i < LENGTH && valtable[i] == sym; i++)
- valtable[i] = null;
+ }
+ if ((to < LENGTH || from2 < LENGTH - 1) && valtable2[l - 1] != null)
+ {
+ sym = valtable2[l - 1];
+ for (i = l - 1; i >= 0; i--)
+ valtable2[i] = null;
}
// move