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

Unified Diff: lib/src/hex/decoder.dart

Issue 1912273003: Make the package strong-mode clean. (Closed) Base URL: git@github.com:dart-lang/convert.git@master
Patch Set: Code review changes Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/hex/encoder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/hex/decoder.dart
diff --git a/lib/src/hex/decoder.dart b/lib/src/hex/decoder.dart
index efb0b0d41b957a744607916c728a4127f58a3ad5..6a31641fc71afed652f8329b3e6fb2cca8765bae 100644
--- a/lib/src/hex/decoder.dart
+++ b/lib/src/hex/decoder.dart
@@ -17,7 +17,8 @@ const hexDecoder = const HexDecoder._();
/// Because two hexadecimal digits correspond to a single byte, this will throw
/// a [FormatException] if given an odd-length string. It will also throw a
/// [FormatException] if given a string containing non-hexadecimal code units.
-class HexDecoder extends Converter<String, List<int>> {
+class HexDecoder
+ extends ChunkedConverter<String, List<int>, String, List<int>> {
const HexDecoder._();
List<int> convert(String string) {
@@ -58,8 +59,8 @@ class _HexDecoderSink extends StringConversionSinkBase {
}
var codeUnits = string.codeUnits;
- var bytes;
- var bytesStart;
+ Uint8List bytes;
+ int bytesStart;
if (_lastDigit == null) {
bytes = new Uint8List((end - start) ~/ 2);
bytesStart = 0;
@@ -118,8 +119,8 @@ class _HexDecoderByteSink extends ByteConversionSinkBase {
return;
}
- var bytes;
- var bytesStart;
+ Uint8List bytes;
+ int bytesStart;
if (_lastDigit == null) {
bytes = new Uint8List((end - start) ~/ 2);
bytesStart = 0;
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/hex/encoder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698