v0.1.4 rc
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed674f9..3cbeead 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,4 +16,8 @@
# 0.1.3
-Bug Fixes
\ No newline at end of file
+Bug Fixes
+
+# 0.1.4
+
+Performance Optimizations
diff --git a/README.md b/README.md
index d284edd..dba4c7a 100644
--- a/README.md
+++ b/README.md
@@ -101,7 +101,7 @@
```yaml
dependencies:
- equatable: ^0.1.2
+ equatable: ^0.1.4
```
Next, we need to install it:
diff --git a/lib/src/equatable.dart b/lib/src/equatable.dart
index 0d0f57e..964dc97 100644
--- a/lib/src/equatable.dart
+++ b/lib/src/equatable.dart
@@ -3,8 +3,6 @@
/// Equatables override their own == and [hashCode] based on
/// the provided `properties`.
abstract class Equatable {
- final int _propHashCode;
-
/// The [List] of `props` (properties) which will be used to determine whether
/// two [Equatables] are equal.
final List props;
@@ -13,8 +11,7 @@
/// will be used to determine whether two [Equatables] are equal.
/// If no properties are provided, `props` will be initialized to
/// `Iterable.empty()`.
- Equatable([this.props = const []])
- : this._propHashCode = _computePropHashCode(props);
+ Equatable([this.props = const []]);
@override
bool operator ==(Object other) =>
@@ -24,9 +21,9 @@
_propsAreEqual(props, other.props);
@override
- int get hashCode => runtimeType.hashCode ^ _propHashCode;
+ int get hashCode => runtimeType.hashCode ^ _propsHashCode;
- static int _computePropHashCode(List props) {
+ int get _propsHashCode {
int hashCode = 0;
props.forEach((prop) {
diff --git a/pubspec.yaml b/pubspec.yaml
index 408c3a4..411184e 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: equatable
description: An abstract class that helps to implement equality without needing to explicitly override == and hashCode.
-version: 0.1.3
+version: 0.1.4
author: felix.angelov <felangelov@gmail.com>
homepage: https://github.com/felangel/equatable