Skip to content

Commit

Permalink
Update to delete use of unnecessary and:
Browse files Browse the repository at this point in the history
  • Loading branch information
Lin777 committed Mar 5, 2021
1 parent 5c4c757 commit e58a096
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Calypso-SystemTools-Core/ClyBrowserMorph.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ ClyBrowserMorph >> confirmEmptySystemQuery: aQuery excluding: classes [
ClyBrowserMorph >> confirmUnusedClasses: classes [
"Returns a vector of size 2
The first value is TRUE when it doesn't have any reference, subclass or is used (for traits), otherwise is FALSE.
The second value is TRUE when in case of having references, subclasses or users and the user agreed to be shown those references, otherwise is FALSE "
The second value is TRUE when in case of having references, subclasses or users and the user agreed to be shown those references, otherwise is FALSE. "
| refQuery noUsers answer subclasses users |

refQuery := ClyClassReferencesQuery toAny: classes from: self systemScope.
"we need to exclude both the class and instance side of the class"
noUsers := self confirmEmptySystemQuery: refQuery excluding: (classes flatCollect: [ :each | { each . each classSide } ]).
subclasses := (classes flatCollect: [:each | each subclasses]) copyWithoutAll: classes.
subclasses ifNotEmpty: [
noUsers at: 1 put: (false and: noUsers first).
noUsers at: 1 put: false.
answer := UIManager default confirm: 'There are subclasses. Show them?'.
answer ifTrue: [ self spawnQueryBrowserOn: (ClyConstantQuery returning: subclasses).
noUsers at: 2 put: true. ] ].

users := (classes flatCollect: [:each | each users]) copyWithoutAll: classes.
users ifNotEmpty: [
noUsers at: 1 put: (false and: noUsers first).
noUsers at: 1 put: false.
answer := UIManager default confirm: 'There are users of trait. Show them?'.
answer ifTrue: [ self spawnQueryBrowserOn: (ClyConstantQuery returning: users).
noUsers at: 2 put: true. ]].
Expand Down

0 comments on commit e58a096

Please sign in to comment.