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

Unified Diff: pkg/analyzer/lib/src/generated/utilities_general.dart

Issue 2508483002: Move scanner tests into the front_end package. (Closed)
Patch Set: Created 4 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
Index: pkg/analyzer/lib/src/generated/utilities_general.dart
diff --git a/pkg/analyzer/lib/src/generated/utilities_general.dart b/pkg/analyzer/lib/src/generated/utilities_general.dart
index b9dca93c681bf8f7f9f51d12122a44e30e9ec685..d13ad3565d27b6ccd39190557d8418a823c22abc 100644
--- a/pkg/analyzer/lib/src/generated/utilities_general.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_general.dart
@@ -7,6 +7,8 @@ library analyzer.src.generated.utilities_general;
import 'dart:collection';
import 'dart:developer' show UserTag;
+export 'package:front_end/src/base/jenkins_smi_hash.dart' show JenkinsSmiHash;
+
/**
* Test if the given [value] is `false` or the string "false" (case-insensitive).
*/
@@ -50,31 +52,6 @@ String toLowerCase(Object value) => value?.toString()?.toLowerCase();
String toUpperCase(Object value) => value?.toString()?.toUpperCase();
/**
- * Jenkins hash function, optimized for small integers.
- * Borrowed from sdk/lib/math/jenkins_smi_hash.dart.
- */
-class JenkinsSmiHash {
- static int combine(int hash, int value) {
- hash = 0x1fffffff & (hash + value);
- hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
- return hash ^ (hash >> 6);
- }
-
- static int finish(int hash) {
- hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
- hash = hash ^ (hash >> 11);
- return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
- }
-
- static int hash2(a, b) => finish(combine(combine(0, a), b));
-
- static int hash3(a, b, c) => finish(combine(combine(combine(0, a), b), c));
-
- static int hash4(a, b, c, d) =>
- finish(combine(combine(combine(combine(0, a), b), c), d));
-}
-
-/**
* A simple limited queue.
*/
class LimitedQueue<E> extends ListQueue<E> {

Powered by Google App Engine
This is Rietveld 408576698