Modify items in List<T> fast
<p>I tried to make this code perform faster using Parallel.ForEach and ConcurrentBag but it's still running way to long (esp. when having in mind that in my scenario i may also be 1.000.000++):</p>

<pre><code>List&lt;Point&gt; points = new List&lt;Point&gt;();
for(int i = 0; i&lt;100000;i++) {
    Point point = new Point {X = i-50000, Y = i+50000, CanDelete = false};
    points.Add(point);
}

foreach (Point point in points) {
    foreach (Point innerPoint in points) {
        if (innerPoint.CanDelete == false &amp;&amp; (point.X - innerPoint.X) &lt; 2) {
            innerPoint.Y = point.Y;
            point.CanDelete = true;
        }
    }
}
</code></pre>
