Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ContentEquals()

bool System.Reflection.Metadata.BlobBuilder.ContentEquals ( BlobBuilder other)
inlineinherited

Definition at line 247 of file BlobBuilder.cs.

248 {
249 if (!IsHead)
250 {
251 Throw.InvalidOperationBuilderAlreadyLinked();
252 }
253 if (this == other)
254 {
255 return true;
256 }
257 if (other == null)
258 {
259 return false;
260 }
261 if (!other.IsHead)
262 {
263 Throw.InvalidOperationBuilderAlreadyLinked();
264 }
265 if (Count != other.Count)
266 {
267 return false;
268 }
269 Chunks chunks = GetChunks();
270 Chunks chunks2 = other.GetChunks();
271 int num = 0;
272 int num2 = 0;
273 bool flag = chunks.MoveNext();
274 bool flag2 = chunks2.MoveNext();
275 while (flag && flag2)
276 {
277 BlobBuilder current = chunks.Current;
278 BlobBuilder current2 = chunks2.Current;
279 int num3 = Math.Min(current.Length - num, current2.Length - num2);
280 if (!ByteSequenceComparer.Equals(current._buffer, num, current2._buffer, num2, num3))
281 {
282 return false;
283 }
284 num += num3;
285 num2 += num3;
286 if (num == current.Length)
287 {
288 flag = chunks.MoveNext();
289 num = 0;
290 }
291 if (num2 == current2.Length)
292 {
293 flag2 = chunks2.MoveNext();
294 num2 = 0;
295 }
296 }
297 return flag == flag2;
298 }
static bool Equals(ImmutableArray< byte > x, ImmutableArray< byte > y)

References System.Reflection.Metadata.BlobBuilder._buffer, System.Reflection.Metadata.BlobBuilder.Count, System.Reflection.Internal.ByteSequenceComparer.Equals(), System.Reflection.Metadata.BlobBuilder.GetChunks(), System.Reflection.Throw.InvalidOperationBuilderAlreadyLinked(), System.Reflection.Metadata.BlobBuilder.IsHead, System.Reflection.Metadata.BlobBuilder.Length, System.Math.Min(), and System.other.