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

Issue 171773003: Allow multi-codeunit padding in String.padLeft/padRight. (Closed)

Created:
6 years, 10 months ago by Lasse Reichstein Nielsen
Modified:
6 years, 10 months ago
Reviewers:
floitsch, sra1
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Ivan Posva
Visibility:
Public.

Description

Allow multi-codeunit padding in String.padLeft/padRight. Also allow negative repeats. Based on suggestions from Stephen. R=sra@google.com Committed: https://code.google.com/p/dart/source/detail?r=32843

Patch Set 1 #

Patch Set 2 : repeat -> operator*. #

Total comments: 10

Patch Set 3 : merge'd sra's patch. #

Patch Set 4 : Type typo. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -127 lines) Patch
M runtime/lib/string_patch.dart View 1 2 5 chunks +46 lines, -64 lines 1 comment Download
M sdk/lib/_internal/lib/js_string.dart View 1 2 3 2 chunks +22 lines, -22 lines 0 comments Download
M sdk/lib/core/string.dart View 1 2 1 chunk +29 lines, -20 lines 0 comments Download
M tests/corelib/core_runtime_types_test.dart View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M tests/corelib/string_test.dart View 1 2 3 chunks +34 lines, -19 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Lasse Reichstein Nielsen
This makes s.padLeft(n, p) really equal to p.repeat(n - s.length) + s And it works. ...
6 years, 10 months ago (2014-02-19 15:01:37 UTC) #1
floitsch
I still think that string.pad should end up with the size the user requests, but ...
6 years, 10 months ago (2014-02-19 15:11:10 UTC) #2
Lasse Reichstein Nielsen
This makes s.padLeft(n, p) really equal to p.repeat(n - s.length) + s And it works. ...
6 years, 10 months ago (2014-02-19 15:21:29 UTC) #3
Lasse Reichstein Nielsen
As a suggestion: Make repeat be operator*. This turns it into proper scalar multiplication, the ...
6 years, 10 months ago (2014-02-19 15:22:12 UTC) #4
floitsch
On 2014/02/19 15:22:12, Lasse Reichstein Nielsen wrote: > As a suggestion: Make repeat be operator*. ...
6 years, 10 months ago (2014-02-19 15:25:02 UTC) #5
sra1
On 2014/02/19 15:25:02, floitsch wrote: > On 2014/02/19 15:22:12, Lasse Reichstein Nielsen wrote: > > ...
6 years, 10 months ago (2014-02-19 18:09:02 UTC) #6
sra1
lgtm I'd like to see the magic .join code go away but that can be ...
6 years, 10 months ago (2014-02-19 21:18:09 UTC) #7
sra1
I reworked the JavaScript implementations for a 5x-8x speed increase. Can you double-check and land ...
6 years, 10 months ago (2014-02-19 23:15:11 UTC) #8
Lasse Reichstein Nielsen
https://codereview.chromium.org/171773003/diff/50001/sdk/lib/_internal/lib/js_string.dart File sdk/lib/_internal/lib/js_string.dart (right): https://codereview.chromium.org/171773003/diff/50001/sdk/lib/_internal/lib/js_string.dart#newcode232 sdk/lib/_internal/lib/js_string.dart:232: return JS('String', "new Array(# + 1).join(#)", times, this); I've ...
6 years, 10 months ago (2014-02-20 07:16:40 UTC) #9
Lasse Reichstein Nielsen
Committed patchset #4 manually as r32843 (presubmit successful).
6 years, 10 months ago (2014-02-20 07:18:06 UTC) #10
Lasse Reichstein Nielsen
6 years, 10 months ago (2014-02-20 13:29:36 UTC) #11
Message was sent while issue was closed.
+iposva since srdjan is otherwise engaged.

Powered by Google App Engine
This is Rietveld 408576698