diff --git a/lib/src/controller/information_provider.dart b/lib/src/controller/information_provider.dart index ba8fe91..d640cd6 100644 --- a/lib/src/controller/information_provider.dart +++ b/lib/src/controller/information_provider.dart @@ -2,7 +2,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:meta/meta.dart'; -import 'package:octopus/src/state/jenkins_hash.dart'; +import 'package:octopus/src/util/jenkins_hash.dart'; /// The route information provider that propagates /// the platform route information changes. diff --git a/lib/src/state/state.dart b/lib/src/state/state.dart index a151792..0524d3a 100644 --- a/lib/src/state/state.dart +++ b/lib/src/state/state.dart @@ -6,8 +6,8 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart' show MaterialPage; import 'package:flutter/widgets.dart'; import 'package:meta/meta.dart'; -import 'package:octopus/src/state/jenkins_hash.dart'; import 'package:octopus/src/state/name_regexp.dart'; +import 'package:octopus/src/util/jenkins_hash.dart'; import 'package:octopus/src/util/state_util.dart'; import 'package:octopus/src/widget/dialog_page.dart'; import 'package:octopus/src/widget/no_animation.dart'; diff --git a/lib/src/util/jenkins_hash.dart b/lib/src/util/jenkins_hash.dart index fe8de86..8feae02 100644 --- a/lib/src/util/jenkins_hash.dart +++ b/lib/src/util/jenkins_hash.dart @@ -21,8 +21,9 @@ int jenkinsHashAll(Iterable? objects) { if (objects == null) return _jenkinsFinish(0); var hash = 0; for (final object in objects) { - hash = _jenkinsCombine(hash, object); + hash ^= _jenkinsCombine(hash, object); } + hash ^= objects.length; return _jenkinsFinish(hash); } diff --git a/test/src/hash_test.dart b/test/src/hash_test.dart index 1d6a3a8..55e6e5f 100644 --- a/test/src/hash_test.dart +++ b/test/src/hash_test.dart @@ -1,6 +1,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:octopus/octopus.dart'; -import 'package:octopus/src/state/jenkins_hash.dart'; +import 'package:octopus/src/util/jenkins_hash.dart'; void main() => group('hash', () { test('list_equals', () {