On Friday, 25 August 2017 at 08:27:41 UTC, Jacob Carlborg wrote:
Since you're converting the returned index to a bool, can't you use "canFind" instead?

immutable englishIndefiniteArticles = [`a`, `an`];
bool isEnglishIndefiniteArticle(S)(S s)
{
    return englishIndefiniteArticles.canFind(s);
}

`s.canFind` has time-complexity O(s.length)

Opposite to the template-parameter overload of `among` which has O(1), making all the difference performance-wise in my case.

Reply via email to