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

Side by Side Diff: sdk/lib/math/jenkins_smi_hash.dart

Issue 2968413002: Revert "Use relative URIs for core library part-of statements." (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « sdk/lib/isolate/capability.dart ('k') | sdk/lib/math/point.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4 part of dart.math;
5 part of "math.dart";
6 5
7 /** 6 /**
8 * This is the [Jenkins hash function][1] but using masking to keep 7 * This is the [Jenkins hash function][1] but using masking to keep
9 * values in SMI range. 8 * values in SMI range.
10 * 9 *
11 * [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function 10 * [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
12 * 11 *
13 * Use: 12 * Use:
14 * Hash each value with the hash of the previous value, then get the final 13 * Hash each value with the hash of the previous value, then get the final
15 * hash by calling finish. 14 * hash by calling finish.
(...skipping 17 matching lines...) Expand all
33 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); 32 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
34 hash = hash ^ (hash >> 11); 33 hash = hash ^ (hash >> 11);
35 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); 34 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
36 } 35 }
37 36
38 static int hash2(a, b) => finish(combine(combine(0, a), b)); 37 static int hash2(a, b) => finish(combine(combine(0, a), b));
39 38
40 static int hash4(a, b, c, d) => 39 static int hash4(a, b, c, d) =>
41 finish(combine(combine(combine(combine(0, a), b), c), d)); 40 finish(combine(combine(combine(combine(0, a), b), c), d));
42 } 41 }
OLDNEW
« no previous file with comments | « sdk/lib/isolate/capability.dart ('k') | sdk/lib/math/point.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698