Use StringView::split() instead of String::split() where suitable and more efficient.
Created attachment 455725 [details] Patch
Comment on attachment 455725 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=455725&action=review r=me > Source/WebCore/html/ValidationMessage.cpp:137 > + size_t i = 0; > + for (auto line : lines) { As you add more loops with explicit 'I' counters, I wonder if we can create some helper class whose purpose is to wrap an iterator and offer a counter automatically. Something like: for (auto line : iteratorWithIndex(lines) { if (line.index() > 1) ... } Or: for (auto line : countedIterator(lines) { if (line.counter() > 1) ... }
Comment on attachment 455725 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=455725&action=review >> Source/WebCore/html/ValidationMessage.cpp:137 >> + for (auto line : lines) { > > As you add more loops with explicit 'I' counters, I wonder if we can create some helper class whose purpose is to wrap an iterator and offer a counter automatically. Something like: > > for (auto line : iteratorWithIndex(lines) { > if (line.index() > 1) > ... > } > > Or: > > for (auto line : countedIterator(lines) { > if (line.counter() > 1) > ... > } Hmm, this is the only case in this patch where I added an 'i' counter it seems. Also, I think in this particular instance, I could probably replace this counter by a simple boolean.
Created attachment 455786 [details] Patch
Committed r291902 (248895@main): <https://commits.webkit.org/248895@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 455786 [details].
<rdar://problem/90862764>