Skip to content

Commit 36d46b6

Browse files
authored
use Object.hashAll (#253)
Use Object.hashAll instead Require Dart >=2.14 * Collapse pre-release versions in changelog
1 parent 0cf5fa4 commit 36d46b6

18 files changed

+27
-61
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
sdk: [2.12.0, dev]
17+
sdk: [2.14.0, dev]
1818

1919
steps:
20-
- uses: actions/checkout@v2
21-
- uses: dart-lang/setup-dart@v1.0
20+
- uses: actions/checkout@v2.3.4
21+
- uses: dart-lang/setup-dart@v1.2
2222
with:
2323
sdk: ${{ matrix.sdk }}
2424
- run: dart pub get

CHANGELOG.md

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,11 @@
1-
## 2.1.1-dev
1+
## 2.1.1
2+
3+
- Deprecate `hash.dart`.
4+
- Require Dart v2.14 or greater.
25

36
## 2.1.0
47

58
- Stable release for null safety.
6-
7-
## 2.1.0-nullsafety.5
8-
9-
- Update SDK constraints to `>=2.12.0-0 <3.0.0` based on beta release
10-
guidelines.
11-
12-
## 2.1.0-nullsafety.4
13-
14-
- Allow prerelease versions of the 2.12 sdk.
15-
16-
## 2.1.0-nullsafety.3
17-
18-
- Allow 2.10 stable and 2.11.0 dev SDK versions.
19-
20-
## 2.1.0-nullsafety.2
21-
22-
- Update for the 2.10 dev sdk.
23-
24-
## 2.1.0-nullsafety.1
25-
26-
- Allow the <=2.9.10 stable sdks.
27-
28-
## 2.1.0-nullsafety
29-
30-
- Migrate to null safety
319
- Improve performance of Matrix4.decompose by reusing objects.
3210

3311
## 2.0.8 - July 2018

lib/hash.dart

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
1-
// Copyrigha (c) 2016, Google Inc. Please see the AUTHORS file for details.
1+
// Copyright (c) 2016, Google Inc. Please see the AUTHORS file for details.
22
// All rights reserved. Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
@Deprecated('Use Object.hashAll instead')
6+
library hash;
7+
58
///
69
/// Generates a hash code for multiple [objects].
710
///
8-
int hashObjects(Iterable<Object> objects) =>
9-
_finish(objects.fold<int>(0, (int h, Object i) => _combine(h, i.hashCode)));
10-
11-
// Jenkins hash functions
12-
int _combine(int hash, int value) {
13-
hash = 0x1fffffff & (hash + value);
14-
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
15-
return hash ^ (hash >> 6);
16-
}
17-
18-
int _finish(int hash) {
19-
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
20-
hash = hash ^ (hash >> 11);
21-
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
22-
}
11+
@Deprecated('Use Object.hashAll instead')
12+
int hashObjects(Iterable<Object> objects) => Object.hashAll(objects);

lib/src/vector_math/matrix2.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class Matrix2 {
153153
(_m2storage[3] == other._m2storage[3]);
154154

155155
@override
156-
int get hashCode => quiver.hashObjects(_m2storage);
156+
int get hashCode => Object.hashAll(_m2storage);
157157

158158
/// Returns row 0
159159
Vector2 get row0 => getRow(0);

lib/src/vector_math/matrix3.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class Matrix3 {
249249
(_m3storage[8] == other._m3storage[8]);
250250

251251
@override
252-
int get hashCode => quiver.hashObjects(_m3storage);
252+
int get hashCode => Object.hashAll(_m3storage);
253253

254254
/// Returns row 0
255255
Vector3 get row0 => getRow(0);

lib/src/vector_math/matrix4.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ class Matrix4 {
541541
(_m4storage[15] == other._m4storage[15]);
542542

543543
@override
544-
int get hashCode => quiver.hashObjects(_m4storage);
544+
int get hashCode => Object.hashAll(_m4storage);
545545

546546
/// Returns row 0
547547
Vector4 get row0 => getRow(0);

lib/src/vector_math/vector2.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Vector2 implements Vector {
102102
(_v2storage[1] == other._v2storage[1]);
103103

104104
@override
105-
int get hashCode => quiver.hashObjects(_v2storage);
105+
int get hashCode => Object.hashAll(_v2storage);
106106

107107
/// Negate.
108108
Vector2 operator -() => clone()..negate();

lib/src/vector_math/vector3.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class Vector3 implements Vector {
111111
(_v3storage[2] == other._v3storage[2]);
112112

113113
@override
114-
int get hashCode => quiver.hashObjects(_v3storage);
114+
int get hashCode => Object.hashAll(_v3storage);
115115

116116
/// Negate
117117
Vector3 operator -() => clone()..negate();

lib/src/vector_math/vector4.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class Vector4 implements Vector {
132132
(_v4storage[3] == other._v4storage[3]);
133133

134134
@override
135-
int get hashCode => quiver.hashObjects(_v4storage);
135+
int get hashCode => Object.hashAll(_v4storage);
136136

137137
/// Negate.
138138
Vector4 operator -() => clone()..negate();

lib/src/vector_math_64/matrix2.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class Matrix2 {
153153
(_m2storage[3] == other._m2storage[3]);
154154

155155
@override
156-
int get hashCode => quiver.hashObjects(_m2storage);
156+
int get hashCode => Object.hashAll(_m2storage);
157157

158158
/// Returns row 0
159159
Vector2 get row0 => getRow(0);

0 commit comments

Comments
 (0)