Skip to content

Commit

Permalink
Use a do: instead of anySatisfy: because it will shortcircuits the lo…
Browse files Browse the repository at this point in the history
…oping on the collection and only treat the first valid package.
  • Loading branch information
guillep committed Jan 9, 2019
1 parent c6b9078 commit 4a1ae62
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ event handling
handlePackagesChange: packages

IceRepository registry do: [ :repository | | changed |
changed := packages anySatisfy: [ :each | each isNotNil and: [ repository notifyPackageModified: each name ] ].
changed := false.
packages do: [ :each | changed := changed | (each isNotNil and: [ repository notifyPackageModified: each name ]) ].
changed ifTrue: [ Iceberg announcer announce: (IceRepositoryModified for: repository) ]]

2 comments on commit 4a1ae62

@dionisiydk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to add test

@guillep
Copy link
Member Author

@guillep guillep commented on 4a1ae62 Jan 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing it properly would require refactoring the entire announcement system. That is not doable right now...

Please sign in to comment.