|
1 | 1 | // Lucene version compatibility level 4.8.1 |
2 | 2 | using Lucene.Net.Diagnostics; |
| 3 | +using Lucene.Net.Support; |
3 | 4 | using System; |
4 | 5 |
|
5 | 6 | namespace Lucene.Net.Analysis.Util |
@@ -182,8 +183,7 @@ public static int Delete(Span<char> s, int pos) |
182 | 183 | if (Debugging.AssertsEnabled) Debugging.Assert(pos < s.Length); |
183 | 184 | if (pos < s.Length - 1) // don't arraycopy if asked to delete last character |
184 | 185 | { |
185 | | - // Arrays.Copy(s, pos + 1, s, pos, len - pos - 1); |
186 | | - s.Slice(pos + 1, s.Length - pos - 1).CopyTo(s.Slice(pos, s.Length - pos - 1)); |
| 186 | + Arrays.Copy(s, pos + 1, s, pos, s.Length - pos - 1); |
187 | 187 | } |
188 | 188 | return s.Length - 1; |
189 | 189 | } |
@@ -220,8 +220,7 @@ public static int DeleteN(Span<char> s, int pos, int nChars) |
220 | 220 | if (Debugging.AssertsEnabled) Debugging.Assert(pos + nChars <= s.Length); |
221 | 221 | if (pos + nChars < s.Length) // don't arraycopy if asked to delete the last characters |
222 | 222 | { |
223 | | - // Arrays.Copy(s, pos + nChars, s, pos, len - pos - nChars); |
224 | | - s.Slice(pos + nChars, s.Length - pos - nChars).CopyTo(s.Slice(pos, s.Length - pos - nChars)); |
| 223 | + Arrays.Copy(s, pos + nChars, s, pos, s.Length - pos - nChars); |
225 | 224 | } |
226 | 225 | return s.Length - nChars; |
227 | 226 | } |
|
0 commit comments