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

Unified Diff: quiver/lib/src/core/hash.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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 | « quiver/lib/src/collection/treeset.dart ('k') | quiver/lib/src/core/optional.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: quiver/lib/src/core/hash.dart
diff --git a/quiver/lib/src/core/hash.dart b/quiver/lib/src/core/hash.dart
deleted file mode 100644
index de5317cc1152e07deb3cddbc79ada4f440c41bd9..0000000000000000000000000000000000000000
--- a/quiver/lib/src/core/hash.dart
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2013 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-part of quiver.core;
-
-/**
- * Generates a hash code for multiple [objects].
- */
-int hashObjects(Iterable objects) =>
- _finish(objects.fold(0, (h, i) => _combine(h, i.hashCode)));
-
-/**
- * Generates a hash code for two objects.
- */
-int hash2(a, b) => _finish(_combine(_combine(0, a.hashCode), b.hashCode));
-
-/**
- * Generates a hash code for three objects.
- */
-int hash3(a, b, c) => _finish(
- _combine(_combine(_combine(0, a.hashCode), b.hashCode), c.hashCode));
-
-/**
- * Generates a hash code for four objects.
- */
-int hash4(a, b, c, d) => _finish(_combine(
- _combine(_combine(_combine(0, a.hashCode), b.hashCode), c.hashCode),
- d.hashCode));
-
-// Jenkins hash functions
-
-int _combine(int hash, int value) {
- hash = 0x1fffffff & (hash + value);
- hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
- return hash ^ (hash >> 6);
-}
-
-int _finish(int hash) {
- hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
- hash = hash ^ (hash >> 11);
- return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
-}
« no previous file with comments | « quiver/lib/src/collection/treeset.dart ('k') | quiver/lib/src/core/optional.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698