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

Unified Diff: pkg/dev_compiler/tool/input_sdk/lib/math/jenkins_smi_hash.dart

Issue 2698353003: unfork DDC's copy of most SDK libraries (Closed)
Patch Set: revert core_patch Created 3 years, 10 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
Index: pkg/dev_compiler/tool/input_sdk/lib/math/jenkins_smi_hash.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/math/jenkins_smi_hash.dart b/pkg/dev_compiler/tool/input_sdk/lib/math/jenkins_smi_hash.dart
deleted file mode 100644
index 8a0056eac9fa5c7e880bf029cfecab9ee8da55df..0000000000000000000000000000000000000000
--- a/pkg/dev_compiler/tool/input_sdk/lib/math/jenkins_smi_hash.dart
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-part of dart.math;
-
-/**
- * This is the [Jenkins hash function][1] but using masking to keep
- * values in SMI range.
- *
- * [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
- *
- * Use:
- * Hash each value with the hash of the previous value, then get the final
- * hash by calling finish.
- *
- * var hash = 0;
- * for (var value in values) {
- * hash = JenkinsSmiHash.combine(hash, value.hashCode);
- * }
- * hash = JenkinsSmiHash.finish(hash);
- */
-class _JenkinsSmiHash {
- // TODO(11617): This class should be optimized and standardized elsewhere.
-
- 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 hash4(a, b, c, d) =>
- finish(combine(combine(combine(combine(0, a), b), c), d));
-}
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/lib/isolate/isolate.dart ('k') | pkg/dev_compiler/tool/input_sdk/lib/math/math.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698