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

Unified Diff: sdk/lib/io/file_impl.dart

Issue 745573002: Create generic check methods for RangeError causing checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix long line Created 6 years, 1 month 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 | « sdk/lib/internal/lists.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file_impl.dart
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index 61ed003ce45a9c71ba486f28eed05f5a98f62a2f..72d5a6d2c2ed9121d796ba9b8c804c7c21629f03 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -713,11 +713,7 @@ class _RandomAccessFile
}
static void _checkReadWriteListArguments(int length, int start, int end) {
- if (start < 0) throw new RangeError.value(start);
- if (end < start) throw new RangeError.value(end);
- if (end > length) {
- throw new RangeError.value(end);
- }
+ RangeError.checkValidRange(start, end, length);
}
external static _readInto(int id, List<int> buffer, int start, int end);
« no previous file with comments | « sdk/lib/internal/lists.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698