lscache icon indicating copy to clipboard operation
lscache copied to clipboard

Extract quota exceeded testing to use an array

Open Flygenring opened this issue 6 years ago • 2 comments

This improves readability while making it simpler to maintain and extend

Flygenring avatar Nov 28 '18 13:11 Flygenring

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?

pamelafox avatar Nov 29 '18 05:11 pamelafox

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.

peter-gribanov avatar Nov 29 '18 08:11 peter-gribanov