|
|
Created:
4 years, 3 months ago by fs Modified:
4 years, 3 months ago Reviewers:
pdr. CC:
fs, blink-reviews, chromium-reviews, krit, f(malita), gyuyoung2, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, Stephen Chennney Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionDon't use substring() for a simple prefix match
The language code match in SVGTests::isValid() uses String::substring()
to limit the match to the primary language subtag. In the case where the
defaultLanguage() only contains the/a primary language subtag, this will
not require a copy, but otherwise it would.
Using startsWith() and a length-check guarantees that no copies will be
made. (A valid primary language subtag is always 2 letter long, so
checking only for length == 2 should be enough, although previously the
code could theoretically match a 1 letter, or even a zero-length tag.)
Committed: https://crrev.com/40dc7d65a9a4208ddb7e60df6536326ead346117
Cr-Commit-Position: refs/heads/master@{#415255}
Patch Set 1 #
Messages
Total messages: 20 (11 generated)
The CQ bit was checked by fs@opera.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
fs@opera.com changed reviewers: + pdr@chromium.org
Sunday night roll
On 2016/08/28 at 22:28:46, fs wrote: > Sunday night roll Sunday night LGTM
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by fs@opera.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by fs@opera.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by fs@opera.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #1 (id:1)
Message was sent while issue was closed.
Description was changed from ========== Don't use substring() for a simple prefix match The language code match in SVGTests::isValid() uses String::substring() to limit the match to the primary language subtag. In the case where the defaultLanguage() only contains the/a primary language subtag, this will not require a copy, but otherwise it would. Using startsWith() and a length-check guarantees that no copies will be made. (A valid primary language subtag is always 2 letter long, so checking only for length == 2 should be enough, although previously the code could theoretically match a 1 letter, or even a zero-length tag.) ========== to ========== Don't use substring() for a simple prefix match The language code match in SVGTests::isValid() uses String::substring() to limit the match to the primary language subtag. In the case where the defaultLanguage() only contains the/a primary language subtag, this will not require a copy, but otherwise it would. Using startsWith() and a length-check guarantees that no copies will be made. (A valid primary language subtag is always 2 letter long, so checking only for length == 2 should be enough, although previously the code could theoretically match a 1 letter, or even a zero-length tag.) Committed: https://crrev.com/40dc7d65a9a4208ddb7e60df6536326ead346117 Cr-Commit-Position: refs/heads/master@{#415255} ==========
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/40dc7d65a9a4208ddb7e60df6536326ead346117 Cr-Commit-Position: refs/heads/master@{#415255} |