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

Unified Diff: packages/utf/lib/src/util.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/utf/lib/src/utf_stream.dart ('k') | packages/utf/lib/utf.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/utf/lib/src/util.dart
diff --git a/packages/utf/lib/src/util.dart b/packages/utf/lib/src/util.dart
index 17427d5c4a839212768538858aae16b8d38f1a84..f94f576e5c9139f56e1fcfc0b6202e9727698506 100644
--- a/packages/utf/lib/src/util.dart
+++ b/packages/utf/lib/src/util.dart
@@ -11,13 +11,14 @@ import 'utf_16_code_unit_decoder.dart';
/**
* Decodes the utf16 codeunits to codepoints.
*/
-List<int> utf16CodeUnitsToCodepoints(
- List<int> utf16CodeUnits, [int offset = 0, int length,
+List<int> utf16CodeUnitsToCodepoints(List<int> utf16CodeUnits,
+ [int offset = 0,
+ int length,
int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
ListRangeIterator source =
(new ListRange(utf16CodeUnits, offset, length)).iterator;
- Utf16CodeUnitDecoder decoder = new Utf16CodeUnitDecoder
- .fromListRangeIterator(source, replacementCodepoint);
+ Utf16CodeUnitDecoder decoder = new Utf16CodeUnitDecoder.fromListRangeIterator(
+ source, replacementCodepoint);
List<int> codepoints = new List<int>(source.remaining);
int i = 0;
while (decoder.moveNext()) {
@@ -35,12 +36,10 @@ List<int> utf16CodeUnitsToCodepoints(
/**
* Encode code points as UTF16 code units.
*/
-List<int> codepointsToUtf16CodeUnits(
- List<int> codepoints,
+List<int> codepointsToUtf16CodeUnits(List<int> codepoints,
[int offset = 0,
- int length,
- int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-
+ int length,
+ int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
ListRange listRange = new ListRange(codepoints, offset, length);
int encodedLength = 0;
for (int value in listRange) {
@@ -66,8 +65,8 @@ List<int> codepointsToUtf16CodeUnits(
int base = value - UNICODE_UTF16_OFFSET;
codeUnitsBuffer[j++] = UNICODE_UTF16_SURROGATE_UNIT_0_BASE +
((base & UNICODE_UTF16_HI_MASK) >> 10);
- codeUnitsBuffer[j++] = UNICODE_UTF16_SURROGATE_UNIT_1_BASE +
- (base & UNICODE_UTF16_LO_MASK);
+ codeUnitsBuffer[j++] =
+ UNICODE_UTF16_SURROGATE_UNIT_1_BASE + (base & UNICODE_UTF16_LO_MASK);
} else if (replacementCodepoint != null) {
codeUnitsBuffer[j++] = replacementCodepoint;
} else {
« no previous file with comments | « packages/utf/lib/src/utf_stream.dart ('k') | packages/utf/lib/utf.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698