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

Unified Diff: mojo/dart/embedder/io/mojo_patch.dart

Issue 1309313002: Fix mojo dart:io IPv6 address printing (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | services/dart/dart_apptests/lib/src/io_internet_address_apptests.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/io/mojo_patch.dart
diff --git a/mojo/dart/embedder/io/mojo_patch.dart b/mojo/dart/embedder/io/mojo_patch.dart
index c31c5fb23cf555aa36e565fc29a45687c1a672ec..d49c6c4a68501f74026eca76f3f3e31b155693b5 100644
--- a/mojo/dart/embedder/io/mojo_patch.dart
+++ b/mojo/dart/embedder/io/mojo_patch.dart
@@ -91,9 +91,14 @@ class _NetworkServiceCodec {
r += '${digit}${divider}';
}
} else {
- for (var i = 0; i < 16; i++) {
- var digit = address[i].toRadixString(16);
- var divider = (i != 15) ? ':' : '';
+ for (var i = 0; i < 16; i += 2) {
+ var first = '';
vtl 2015/08/24 21:39:12 drive-by: I'm not sure why something like var dig
+ if (address[i] != 0) {
+ first = address[i].toRadixString(16).padLeft(2, '0');
+ }
+ var second = address[i + 1].toRadixString(16).padLeft(2, '0');
+ var digit = '$first$second';
+ var divider = (i != 14) ? ':' : '';
r += '${digit}${divider}';
}
}
« no previous file with comments | « no previous file | services/dart/dart_apptests/lib/src/io_internet_address_apptests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698