madskristensen/JSON-Intellisense — pull request #8 by lurumad (2014-09-24 12:49:48+00:00)
Title: Avoid O(n) complexity using Any() instead of Count()

We only want to know if IEnumerable has at least one element that is an O(1) operation but you are using Count() that is an O(n) operation. Any() fetchs an iterator and checks if MoveNext() return true:

public static bool Any(this IEnumerable source)
{
if (source == null)
{
throw Error.ArgumentNull("source");
}
using (IEnumerator enumerator = source.GetEnumerator())
{
if (enumerator.MoveNext())
{
return true;
}
}
return false;
}

Regards!