Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Issue 2284273002: Don't use substring() for a simple prefix match (Closed)

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.

Description

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}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -5 lines) Patch
M third_party/WebKit/Source/core/svg/SVGTests.cpp View 1 chunk +2 lines, -5 lines 0 comments Download

Messages

Total messages: 20 (11 generated)
fs
Sunday night roll
4 years, 3 months ago (2016-08-28 22:28:46 UTC) #4
pdr.
On 2016/08/28 at 22:28:46, fs wrote: > Sunday night roll Sunday night LGTM
4 years, 3 months ago (2016-08-28 23:32:59 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2284273002/1
4 years, 3 months ago (2016-08-29 07:52:13 UTC) #9
commit-bot: I haz the power
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_android_rel_ng/builds/131798)
4 years, 3 months ago (2016-08-29 08:59:51 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2284273002/1
4 years, 3 months ago (2016-08-29 18:12:06 UTC) #13
commit-bot: I haz the power
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_ng/builds/283771)
4 years, 3 months ago (2016-08-30 05:44:24 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2284273002/1
4 years, 3 months ago (2016-08-30 07:54:59 UTC) #17
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 3 months ago (2016-08-30 09:29:35 UTC) #18
commit-bot: I haz the power
4 years, 3 months ago (2016-08-30 09:31:11 UTC) #20
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/40dc7d65a9a4208ddb7e60df6536326ead346117
Cr-Commit-Position: refs/heads/master@{#415255}

Powered by Google App Engine
This is Rietveld 408576698