Skip to content

Commit 14c109e

Browse files
committed
Fix build for .NET5
1 parent cc92629 commit 14c109e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Orm/Xtensive.Orm/Core/ValueStringBuilder.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,17 @@ public void Insert(int index, string? s)
154154
Grow(count);
155155
}
156156

157+
#if NET6_0_OR_GREATE
157158
int remaining = _pos - index;
158159
_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count));
159160
s.CopyTo(_chars.Slice(index));
160161
_pos += count;
162+
#else
163+
int remaining = _pos - index;
164+
_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count));
165+
s.AsSpan().CopyTo(_chars.Slice(index));
166+
_pos += count;
167+
#endif
161168
}
162169

163170
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -201,7 +208,11 @@ private void AppendSlow(string s)
201208
Grow(s.Length);
202209
}
203210

211+
#if NET6_0_OR_GREATER
204212
s.CopyTo(_chars.Slice(pos));
213+
#else
214+
s.AsSpan().CopyTo(_chars.Slice(pos));
215+
#endif
205216
_pos += s.Length;
206217
}
207218

0 commit comments

Comments
 (0)