Updated mappings for Predicate, Func0, and Func1

This commit is contained in:
Sam Harwell 2013-02-17 20:59:53 -06:00
parent 9a3d80d115
commit a7df354202
3 changed files with 6 additions and 20 deletions

View File

@ -27,6 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Text;
using Antlr4.Runtime.Misc;
@ -103,7 +104,7 @@ namespace Antlr4.Runtime.Misc
return buf.ToString();
}
public static void RemoveAll<T, _T1>(IList<T> list, IPredicate<_T1> predicate)
public static void RemoveAll<T, _T1>(IList<T> list, Predicate<_T1> predicate)
{
int j = 0;
for (int i = 0; i < list.Count; i++)
@ -123,23 +124,5 @@ namespace Antlr4.Runtime.Misc
list.SubList(j, list.Count).Clear();
}
}
public static void RemoveAll<T, _T1>(IEnumerable<T> iterable, IPredicate<_T1> predicate
)
{
if (iterable is IList<object>)
{
RemoveAll((IList<T>)iterable, predicate);
return;
}
for (IEnumerator<T> iterator = iterable.GetEnumerator(); iterator.HasNext(); )
{
T item = iterator.Next();
if (predicate.Eval(item))
{
iterator.Remove();
}
}
}
}
}

@ -1 +1 @@
Subproject commit 9209ffea852fc94a198496bdb87babd0def4148e
Subproject commit 55e0958300f33236e916623077fd356fc6914b6d

View File

@ -193,6 +193,9 @@
-methodMapping org.antlr.v4.runtime.misc.EqualityComparator.hashCode GetHashCode
-typeMapping org.antlr.v4.runtime.misc.AbstractEqualityComparator<> System.Collections.Generic.EqualityComparer
-typeMapping org.antlr.v4.runtime.misc.FlexibleHashMap<,> System.Collections.Generic.Dictionary
-typeMapping org.antlr.v4.runtime.misc.Predicate<> System.Predicate
-typeMapping org.antlr.v4.runtime.misc.Func0<> System.Func
-typeMapping org.antlr.v4.runtime.misc.Func1<,> System.Func
-typeMapping org.antlr.v4.runtime.misc.Tuple System.Tuple
-typeMapping org.antlr.v4.runtime.misc.Tuple2<,> System.Tuple