use Object.hashAll (#253)
Use Object.hashAll instead
Require Dart >=2.14
* Collapse pre-release versions in changelog
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 34a3a80..c57edaf 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,11 +14,11 @@
strategy:
fail-fast: false
matrix:
- sdk: [2.12.0, dev]
+ sdk: [2.14.0, dev]
steps:
- - uses: actions/checkout@v2
- - uses: dart-lang/setup-dart@v1.0
+ - uses: actions/checkout@v2.3.4
+ - uses: dart-lang/setup-dart@v1.2
with:
sdk: ${{ matrix.sdk }}
- run: dart pub get
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f071234..f315939 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,33 +1,11 @@
-## 2.1.1-dev
+## 2.1.1
+
+- Deprecate `hash.dart`.
+- Require Dart v2.14 or greater.
## 2.1.0
- Stable release for null safety.
-
-## 2.1.0-nullsafety.5
-
-- Update SDK constraints to `>=2.12.0-0 <3.0.0` based on beta release
- guidelines.
-
-## 2.1.0-nullsafety.4
-
-- Allow prerelease versions of the 2.12 sdk.
-
-## 2.1.0-nullsafety.3
-
-- Allow 2.10 stable and 2.11.0 dev SDK versions.
-
-## 2.1.0-nullsafety.2
-
-- Update for the 2.10 dev sdk.
-
-## 2.1.0-nullsafety.1
-
-- Allow the <=2.9.10 stable sdks.
-
-## 2.1.0-nullsafety
-
-- Migrate to null safety
- Improve performance of Matrix4.decompose by reusing objects.
## 2.0.8 - July 2018
diff --git a/lib/hash.dart b/lib/hash.dart
index d5fbfb5..1f1b8d4 100644
--- a/lib/hash.dart
+++ b/lib/hash.dart
@@ -1,22 +1,12 @@
-// Copyrigha (c) 2016, Google Inc. Please see the AUTHORS file for details.
+// Copyright (c) 2016, Google Inc. 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.
+@Deprecated('Use Object.hashAll instead')
+library hash;
+
///
/// Generates a hash code for multiple [objects].
///
-int hashObjects(Iterable<Object> objects) =>
- _finish(objects.fold<int>(0, (int h, Object i) => _combine(h, i.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));
-}
+@Deprecated('Use Object.hashAll instead')
+int hashObjects(Iterable<Object> objects) => Object.hashAll(objects);
diff --git a/lib/src/vector_math/matrix2.dart b/lib/src/vector_math/matrix2.dart
index 51f73b6..42dfb3f 100644
--- a/lib/src/vector_math/matrix2.dart
+++ b/lib/src/vector_math/matrix2.dart
@@ -153,7 +153,7 @@
(_m2storage[3] == other._m2storage[3]);
@override
- int get hashCode => quiver.hashObjects(_m2storage);
+ int get hashCode => Object.hashAll(_m2storage);
/// Returns row 0
Vector2 get row0 => getRow(0);
diff --git a/lib/src/vector_math/matrix3.dart b/lib/src/vector_math/matrix3.dart
index 9d11107..026e31a 100644
--- a/lib/src/vector_math/matrix3.dart
+++ b/lib/src/vector_math/matrix3.dart
@@ -249,7 +249,7 @@
(_m3storage[8] == other._m3storage[8]);
@override
- int get hashCode => quiver.hashObjects(_m3storage);
+ int get hashCode => Object.hashAll(_m3storage);
/// Returns row 0
Vector3 get row0 => getRow(0);
diff --git a/lib/src/vector_math/matrix4.dart b/lib/src/vector_math/matrix4.dart
index 3ae0f0d..f4c18ba 100644
--- a/lib/src/vector_math/matrix4.dart
+++ b/lib/src/vector_math/matrix4.dart
@@ -541,7 +541,7 @@
(_m4storage[15] == other._m4storage[15]);
@override
- int get hashCode => quiver.hashObjects(_m4storage);
+ int get hashCode => Object.hashAll(_m4storage);
/// Returns row 0
Vector4 get row0 => getRow(0);
diff --git a/lib/src/vector_math/vector2.dart b/lib/src/vector_math/vector2.dart
index eb2aa21..5881bb1 100644
--- a/lib/src/vector_math/vector2.dart
+++ b/lib/src/vector_math/vector2.dart
@@ -102,7 +102,7 @@
(_v2storage[1] == other._v2storage[1]);
@override
- int get hashCode => quiver.hashObjects(_v2storage);
+ int get hashCode => Object.hashAll(_v2storage);
/// Negate.
Vector2 operator -() => clone()..negate();
diff --git a/lib/src/vector_math/vector3.dart b/lib/src/vector_math/vector3.dart
index 6ed3d08..2c4f373 100644
--- a/lib/src/vector_math/vector3.dart
+++ b/lib/src/vector_math/vector3.dart
@@ -111,7 +111,7 @@
(_v3storage[2] == other._v3storage[2]);
@override
- int get hashCode => quiver.hashObjects(_v3storage);
+ int get hashCode => Object.hashAll(_v3storage);
/// Negate
Vector3 operator -() => clone()..negate();
diff --git a/lib/src/vector_math/vector4.dart b/lib/src/vector_math/vector4.dart
index e200d8d..ee3b492 100644
--- a/lib/src/vector_math/vector4.dart
+++ b/lib/src/vector_math/vector4.dart
@@ -132,7 +132,7 @@
(_v4storage[3] == other._v4storage[3]);
@override
- int get hashCode => quiver.hashObjects(_v4storage);
+ int get hashCode => Object.hashAll(_v4storage);
/// Negate.
Vector4 operator -() => clone()..negate();
diff --git a/lib/src/vector_math_64/matrix2.dart b/lib/src/vector_math_64/matrix2.dart
index c5e9074..03a1212 100644
--- a/lib/src/vector_math_64/matrix2.dart
+++ b/lib/src/vector_math_64/matrix2.dart
@@ -153,7 +153,7 @@
(_m2storage[3] == other._m2storage[3]);
@override
- int get hashCode => quiver.hashObjects(_m2storage);
+ int get hashCode => Object.hashAll(_m2storage);
/// Returns row 0
Vector2 get row0 => getRow(0);
diff --git a/lib/src/vector_math_64/matrix3.dart b/lib/src/vector_math_64/matrix3.dart
index 79c8e0e..b17fc05 100644
--- a/lib/src/vector_math_64/matrix3.dart
+++ b/lib/src/vector_math_64/matrix3.dart
@@ -249,7 +249,7 @@
(_m3storage[8] == other._m3storage[8]);
@override
- int get hashCode => quiver.hashObjects(_m3storage);
+ int get hashCode => Object.hashAll(_m3storage);
/// Returns row 0
Vector3 get row0 => getRow(0);
diff --git a/lib/src/vector_math_64/matrix4.dart b/lib/src/vector_math_64/matrix4.dart
index 77f227a..019954d 100644
--- a/lib/src/vector_math_64/matrix4.dart
+++ b/lib/src/vector_math_64/matrix4.dart
@@ -541,7 +541,7 @@
(_m4storage[15] == other._m4storage[15]);
@override
- int get hashCode => quiver.hashObjects(_m4storage);
+ int get hashCode => Object.hashAll(_m4storage);
/// Returns row 0
Vector4 get row0 => getRow(0);
diff --git a/lib/src/vector_math_64/vector2.dart b/lib/src/vector_math_64/vector2.dart
index 0a6aebf..d878fd1 100644
--- a/lib/src/vector_math_64/vector2.dart
+++ b/lib/src/vector_math_64/vector2.dart
@@ -102,7 +102,7 @@
(_v2storage[1] == other._v2storage[1]);
@override
- int get hashCode => quiver.hashObjects(_v2storage);
+ int get hashCode => Object.hashAll(_v2storage);
/// Negate.
Vector2 operator -() => clone()..negate();
diff --git a/lib/src/vector_math_64/vector3.dart b/lib/src/vector_math_64/vector3.dart
index 127488f..7298c13 100644
--- a/lib/src/vector_math_64/vector3.dart
+++ b/lib/src/vector_math_64/vector3.dart
@@ -111,7 +111,7 @@
(_v3storage[2] == other._v3storage[2]);
@override
- int get hashCode => quiver.hashObjects(_v3storage);
+ int get hashCode => Object.hashAll(_v3storage);
/// Negate
Vector3 operator -() => clone()..negate();
diff --git a/lib/src/vector_math_64/vector4.dart b/lib/src/vector_math_64/vector4.dart
index cff83f8..843c961 100644
--- a/lib/src/vector_math_64/vector4.dart
+++ b/lib/src/vector_math_64/vector4.dart
@@ -132,7 +132,7 @@
(_v4storage[3] == other._v4storage[3]);
@override
- int get hashCode => quiver.hashObjects(_v4storage);
+ int get hashCode => Object.hashAll(_v4storage);
/// Negate.
Vector4 operator -() => clone()..negate();
diff --git a/lib/vector_math.dart b/lib/vector_math.dart
index 295a8ef..92ed0b5 100644
--- a/lib/vector_math.dart
+++ b/lib/vector_math.dart
@@ -17,7 +17,6 @@
import 'dart:math' as math;
import 'dart:typed_data';
-import 'hash.dart' as quiver;
part 'src/vector_math/utilities.dart';
part 'src/vector_math/aabb2.dart';
diff --git a/lib/vector_math_64.dart b/lib/vector_math_64.dart
index 9d5e6a3..74d6066 100644
--- a/lib/vector_math_64.dart
+++ b/lib/vector_math_64.dart
@@ -17,7 +17,6 @@
import 'dart:math' as math;
import 'dart:typed_data';
-import 'hash.dart' as quiver;
part 'src/vector_math_64/utilities.dart';
part 'src/vector_math_64/aabb2.dart';
diff --git a/pubspec.yaml b/pubspec.yaml
index db00bdb..da31486 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,10 +1,10 @@
name: vector_math
-version: 2.1.1-dev
+version: 2.1.1
description: A Vector Math library for 2D and 3D applications.
repository: https://github.com/google/vector_math.dart
environment:
- sdk: ">=2.12.0 <3.0.0"
+ sdk: ">=2.14.0 <3.0.0"
dev_dependencies:
benchmark_harness: ^2.0.0