lscache
lscache copied to clipboard
Extract quota exceeded testing to use an array
This improves readability while making it simpler to maintain and extend
Hmmm. Maybe this is me being overly curmudgeonly, but I believe that Array.indexOf is a more recent addition to browsers than localStorage, so introducing it could potentially reduce the usability of lscache across browsers. I'm hesitant to make a change that could reduce the browser compatibility, if it doesn't have a big benefit. Anyone else have thoughts?
About browsers support localStorage and Array.indexOf. The main problem as always in IE.
According to StatCounter:
- IE8 uses 0.38%
- IE9 uses 0.25%.
According to NetMarketShare:
- IE6 uses 0.18%
- IE7 uses 0.16%
- IE8 uses 1.06%
- IE9 uses 0.46%
In my opinion, this optimization does not add readability and performance. I would recommend to postpone this PR for some time.