Skip to main content
Code Review

Return to Answer

Commonmark migration
Source Link

#Bug?

Bug?

The queue destroys itself during a resize because

public void Enqueue(System.String item)
{
 if(Count == _container.Length) ReSize(Count * 2);
 _container[_topHook++] = item;
}

this allows me to enqueue a null string but it gets lost here

for(var i = 0; i < _container.Length; i++)
 if(_container[i] != null)
 container[j++] = _container[i];

where the copy loop won't copy it. So if I had queued ["foo", null, "bar"] a resize would result in ["foo", "bar"].

You either should prevent enquing null or don't change the content.

#Bug?

The queue destroys itself during a resize because

public void Enqueue(System.String item)
{
 if(Count == _container.Length) ReSize(Count * 2);
 _container[_topHook++] = item;
}

this allows me to enqueue a null string but it gets lost here

for(var i = 0; i < _container.Length; i++)
 if(_container[i] != null)
 container[j++] = _container[i];

where the copy loop won't copy it. So if I had queued ["foo", null, "bar"] a resize would result in ["foo", "bar"].

You either should prevent enquing null or don't change the content.

Bug?

The queue destroys itself during a resize because

public void Enqueue(System.String item)
{
 if(Count == _container.Length) ReSize(Count * 2);
 _container[_topHook++] = item;
}

this allows me to enqueue a null string but it gets lost here

for(var i = 0; i < _container.Length; i++)
 if(_container[i] != null)
 container[j++] = _container[i];

where the copy loop won't copy it. So if I had queued ["foo", null, "bar"] a resize would result in ["foo", "bar"].

You either should prevent enquing null or don't change the content.

added 1 character in body
Source Link
t3chb0t
  • 44.7k
  • 9
  • 84
  • 190

#Bug?

The queue destroys itself during a resize because

public void Enqueue(System.String item)
{
 if(Count == _container.Length) ReSize(Count * 2);
 _container[_topHook++] = item;
}

this allows me to enqueue a null string but it gets lost here

for(var i = 0; i < _container.Length; i++)
 if(_container[i] != null)
 container[j++] = _container[i];

where the copy loop won't copy it. So if I had queued ["foo["foo", null, "bar"] a resize would result in ["foo", "bar"].

You either should prevent enquing null or don't change the content.

#Bug?

The queue destroys itself during a resize because

public void Enqueue(System.String item)
{
 if(Count == _container.Length) ReSize(Count * 2);
 _container[_topHook++] = item;
}

this allows me to enqueue a null string but it gets lost here

for(var i = 0; i < _container.Length; i++)
 if(_container[i] != null)
 container[j++] = _container[i];

where the copy loop won't copy it. So if I had queued ["foo, null, "bar"] a resize would result in ["foo", "bar"].

You either should prevent enquing null or don't change the content.

#Bug?

The queue destroys itself during a resize because

public void Enqueue(System.String item)
{
 if(Count == _container.Length) ReSize(Count * 2);
 _container[_topHook++] = item;
}

this allows me to enqueue a null string but it gets lost here

for(var i = 0; i < _container.Length; i++)
 if(_container[i] != null)
 container[j++] = _container[i];

where the copy loop won't copy it. So if I had queued ["foo", null, "bar"] a resize would result in ["foo", "bar"].

You either should prevent enquing null or don't change the content.

Source Link
t3chb0t
  • 44.7k
  • 9
  • 84
  • 190

#Bug?

The queue destroys itself during a resize because

public void Enqueue(System.String item)
{
 if(Count == _container.Length) ReSize(Count * 2);
 _container[_topHook++] = item;
}

this allows me to enqueue a null string but it gets lost here

for(var i = 0; i < _container.Length; i++)
 if(_container[i] != null)
 container[j++] = _container[i];

where the copy loop won't copy it. So if I had queued ["foo, null, "bar"] a resize would result in ["foo", "bar"].

You either should prevent enquing null or don't change the content.

lang-cs

AltStyle によって変換されたページ (->オリジナル) /