Skip to content

Commit

Permalink
v0.1.4 rc
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel committed Jan 7, 2019
1 parent 6f2d66d commit 3b93e00
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ Additional Updates to Documentation.

# 0.1.3

Bug Fixes
Bug Fixes

# 0.1.4

Performance Optimizations
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ First, we need to do add `equatable` to the dependencies of the `pubspec.yaml`

```yaml
dependencies:
equatable: ^0.1.2
equatable: ^0.1.4
```
Next, we need to install it:
Expand Down
9 changes: 3 additions & 6 deletions lib/src/equatable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -13,8 +11,7 @@ abstract class Equatable {
/// 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) =>
Expand All @@ -24,9 +21,9 @@ abstract class Equatable {
_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) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
homepage: https://github.com/felangel/equatable

Expand Down

0 comments on commit 3b93e00

Please sign in to comment.