From bfb76c2991a4ea4bf1146b85f63a10594687e437 Mon Sep 17 00:00:00 2001 From: ntakahas Date: Mon, 15 Jun 2009 12:41:52 +0000 Subject: [PATCH] *** empty log message *** --- frontsensitive.cs | 6 ------ rearsensitive.cs | 17 ++++++++--------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/frontsensitive.cs b/frontsensitive.cs index fda06e3..854dd0d 100644 --- a/frontsensitive.cs +++ b/frontsensitive.cs @@ -77,16 +77,12 @@ public class Test 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; } @@ -104,8 +100,6 @@ public class Test 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; } diff --git a/rearsensitive.cs b/rearsensitive.cs index ddd06e0..37d5e98 100644 --- a/rearsensitive.cs +++ b/rearsensitive.cs @@ -79,16 +79,12 @@ public class Test 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 @@ -98,8 +94,7 @@ public class Test // 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) @@ -107,8 +102,12 @@ public class Test 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 -- 1.7.10.4