<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Issue with RemoveByTag]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1026</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1026&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Issue with RemoveByTag.]]></description>
		<lastBuildDate>Mon, 04 Feb 2019 19:26:48 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Issue with RemoveByTag]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4541#p4541</link>
			<description><![CDATA[<p>Hello.</p><p>Thank you for the bug report.<br />The problem has been fixed.<br />In the next version this will work correctly.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 04 Feb 2019 19:26:48 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4541#p4541</guid>
		</item>
		<item>
			<title><![CDATA[Issue with RemoveByTag]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4539#p4539</link>
			<description><![CDATA[<p>In OnlineMapsMarkerManagerBase.cs, the RemoveByTag has<br /></p><div class="codebox"><pre><code>RemoveAll(m =&gt;
        {
            for (int j = 0; j &lt; tags.Length; j++) if (m.tags.Contains(tags[j])) return true;
            return false;
        });</code></pre></div><br /><p>In the &quot;RemoveAll&quot; method, the default for &quot;dispose&quot; is true, so it will go through the predicate sent from above and call Dispose on each element. The Dispose method for the map markers does</p><div class="codebox"><pre><code> tag = null </code></pre></div><p>This poses a problem in the next line of the RemoveAll method that does</p><div class="codebox"><pre><code> items.RemoveAll(match) </code></pre></div><p>this again calls the predicate, but this time &quot;m.tags.Contains...&quot; will throw a null error.</p><p>It seems more efficient to instead have the RemoveAll method be something like this ...</p><div class="codebox"><pre><code>        List&lt;U&gt; matchingItems = items.FindAll(match);
        foreach (U item in matchingItems)
        {
            items.Remove(item);
            if(dispose)
            {
                item.Dispose();
            }
        }

        Redraw();</code></pre></div><p>We heavily use tags and this is killing our port to v3!<br />Thanks!<br />-m</p>]]></description>
			<author><![CDATA[null@example.com (vai-ma)]]></author>
			<pubDate>Mon, 04 Feb 2019 17:54:38 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4539#p4539</guid>
		</item>
	</channel>
</rss>
