| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:collection'; | 5 import 'dart:collection'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Implementation of [Uri] that understands only a limited set of valid | 8 * Implementation of [Uri] that understands only a limited set of valid |
| 9 * URI formats, but works fast. In practice Dart code almost always uses such | 9 * URI formats, but works fast. In practice Dart code almost always uses such |
| 10 * limited URI format, so almost always can be processed fast. | 10 * limited URI format, so almost always can be processed fast. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 final String _text; | 23 final String _text; |
| 24 final String _scheme; | 24 final String _scheme; |
| 25 final bool _hasEmptyAuthority; | 25 final bool _hasEmptyAuthority; |
| 26 final String _path; | 26 final String _path; |
| 27 | 27 |
| 28 /** | 28 /** |
| 29 * The offset of the last `/` in [_text], or `null` if there isn't any. | 29 * The offset of the last `/` in [_text], or `null` if there isn't any. |
| 30 */ | 30 */ |
| 31 final int _lastSlashIndex; | 31 final int _lastSlashIndex; |
| 32 | 32 |
| 33 /** | |
| 34 * The cached hashcode. | |
| 35 */ | |
| 36 int _hashCode; | |
| 37 | |
| 38 Uri _cachedFallbackUri; | 33 Uri _cachedFallbackUri; |
| 39 | 34 |
| 40 FastUri._(this._cacheGeneration, this._text, this._scheme, | 35 FastUri._(this._cacheGeneration, this._text, this._scheme, |
| 41 this._hasEmptyAuthority, this._path, this._lastSlashIndex); | 36 this._hasEmptyAuthority, this._path, this._lastSlashIndex); |
| 42 | 37 |
| 43 @override | 38 @override |
| 44 String get authority => ''; | 39 String get authority => ''; |
| 45 | 40 |
| 46 @override | 41 @override |
| 47 UriData get data => null; | 42 UriData get data => null; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 hasEmptyAuthority = true; | 261 hasEmptyAuthority = true; |
| 267 path = path.substring(2); | 262 path = path.substring(2); |
| 268 if (!path.startsWith('/')) { | 263 if (!path.startsWith('/')) { |
| 269 return null; | 264 return null; |
| 270 } | 265 } |
| 271 } | 266 } |
| 272 return new FastUri._(_currentCacheGeneration, text, scheme, | 267 return new FastUri._(_currentCacheGeneration, text, scheme, |
| 273 hasEmptyAuthority, path, lastSlashIndex); | 268 hasEmptyAuthority, path, lastSlashIndex); |
| 274 } | 269 } |
| 275 } | 270 } |
| OLD | NEW |