158 {
159 ReadOnlySpan<bool> readOnlySpan = default(Span<bool>);
160 if ((forceEscape1 | forceEscape2) == 0)
161 {
163 }
164 else
165 {
166 Span<bool> span = stackalloc bool[128];
168 span[forceEscape1] = false;
169 span[forceEscape2] = false;
170 readOnlySpan = span;
171 }
173 for (i = 0;
i < stringToEscape.
Length;
i++)
174 {
176 if ((
index = stringToEscape[i]) >
'\u007f')
177 {
178 break;
179 }
180 if (!readOnlySpan[
index])
181 {
182 break;
183 }
184 }
185 if (i == stringToEscape.
Length)
186 {
187 dest.Append(stringToEscape);
188 return;
189 }
190 dest.Append(stringToEscape.
Slice(0, i));
191 ReadOnlySpan<bool> noEscape =
MemoryMarshal.CreateReadOnlySpan(ref
MemoryMarshal.GetReference(readOnlySpan), readOnlySpan.Length);
193 }
static ReadOnlySpan< bool > UnreservedReservedTable
static void EscapeStringToBuilder(ReadOnlySpan< char > stringToEscape, ref System.Text.ValueStringBuilder vsb, ReadOnlySpan< bool > noEscape, bool checkExistingEscaped)
ReadOnlySpan< T > Slice(int start)