From: ntakahas Date: Mon, 15 Jun 2009 12:41:52 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfb76c2991a4ea4bf1146b85f63a10594687e437;p=m17n%2Fm17n-lib-cs.git *** empty log message *** --- 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