Open redtopia opened 7 years ago
Sounds like an easy fix. Patch is welcomed
Not sure what can be done about performance. I'm getting about 200ms for a lookup. Also, the entire dataset requires about 125 MB of memory. I wonder if there's any way around doing a sequential search to find the best regex for UA.
There's a java library here: https://github.com/ankushs92/Browscap4j which could be useful. Instead of implementing it in CF, a CFC could be written as a wrapper around the java library. Looks like the average response time is a little better than 1/2 as much as doing a sequential search.
I added some caching and I'm getting 0 ms returned (using EHCache), so that's also an option.
Lucee passes arrays by reference, so convertPatternToRegex() ends up modifying the source array, preventing any matches in getBrowser().