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

Side by Side Diff: pkg/analyzer/lib/src/dart/scanner/reader.dart

Issue 1940703002: Remove an unnecessary invocation of toString (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.dart.scanner.reader; 5 library analyzer.src.dart.scanner.reader;
6 6
7 /** 7 /**
8 * A [CharacterReader] that reads a range of characters from another character 8 * A [CharacterReader] that reads a range of characters from another character
9 * reader. 9 * reader.
10 */ 10 */
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 @override 136 @override
137 int advance() { 137 int advance() {
138 if (_charOffset >= _stringLength) { 138 if (_charOffset >= _stringLength) {
139 return -1; 139 return -1;
140 } 140 }
141 return _sequence.codeUnitAt(_charOffset++); 141 return _sequence.codeUnitAt(_charOffset++);
142 } 142 }
143 143
144 @override 144 @override
145 String getString(int start, int endDelta) => 145 String getString(int start, int endDelta) =>
146 _sequence.substring(start, _charOffset + endDelta).toString(); 146 _sequence.substring(start, _charOffset + endDelta);
147 147
148 @override 148 @override
149 int peek() { 149 int peek() {
150 if (_charOffset >= _stringLength) { 150 if (_charOffset >= _stringLength) {
151 return -1; 151 return -1;
152 } 152 }
153 return _sequence.codeUnitAt(_charOffset); 153 return _sequence.codeUnitAt(_charOffset);
154 } 154 }
155 } 155 }
156 156
(...skipping 21 matching lines...) Expand all
178 178
179 @override 179 @override
180 void set offset(int offset) { 180 void set offset(int offset) {
181 super.offset = offset - _offsetDelta; 181 super.offset = offset - _offsetDelta;
182 } 182 }
183 183
184 @override 184 @override
185 String getString(int start, int endDelta) => 185 String getString(int start, int endDelta) =>
186 super.getString(start - _offsetDelta, endDelta); 186 super.getString(start - _offsetDelta, endDelta);
187 } 187 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698