Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29892563: Issue 6989 - Optimize CSS rule generation (Closed)

Created:
Sept. 26, 2018, 2:05 p.m. by Manish Jethani
Modified:
Sept. 26, 2018, 4:55 p.m.
Reviewers:
hub
Base URL:
https://hg.adblockplus.org/adblockpluscore/
Visibility:
Public.

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -9 lines) Patch
M lib/elemHide.js View 1 chunk +13 lines, -9 lines 2 comments Download

Messages

Total messages: 4
Manish Jethani
Sept. 26, 2018, 2:05 p.m. (2018-09-26 14:05:47 UTC) #1
Manish Jethani
https://codereview.adblockplus.org/29892563/diff/29892564/lib/elemHide.js File lib/elemHide.js (right): https://codereview.adblockplus.org/29892563/diff/29892564/lib/elemHide.js#newcode288 lib/elemHide.js:288: for (let i = 0; i < selectors.length - ...
Sept. 26, 2018, 3:29 p.m. (2018-09-26 15:29:56 UTC) #2
Manish Jethani
Patch Set 1 See issue description and inline comments here. On 2018/09/26 15:29:56, Manish Jethani ...
Sept. 26, 2018, 3:30 p.m. (2018-09-26 15:30:28 UTC) #3
hub
Sept. 26, 2018, 4:49 p.m. (2018-09-26 16:49:11 UTC) #4
LGTM

https://codereview.adblockplus.org/29892563/diff/29892564/lib/elemHide.js
File lib/elemHide.js (right):

https://codereview.adblockplus.org/29892563/diff/29892564/lib/elemHide.js#new...
lib/elemHide.js:288: for (let i = 0; i < selectors.length - 1; i++)
On 2018/09/26 15:29:56, Manish Jethani wrote:
> I tried a few things here:
> 
>  1.  Used `for...of` and sliced out the ", " at the end before appending "
> {display: none !important;}\n"
>  2.  Used `selectors.pop()`, a `for...of` loop, and concatenated the last
> element in the array at the end
>  3.  Used a regular `for` loop until the second to last entry, then
concatenated
> the last entry at the end
> 
> The last one (which is in the current patch) performs the best.

Acknowledged.

Powered by Google App Engine
This is Rietveld