Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Doubled method definition #9

@frankshearar

Description

@frankshearar

This comes from https://github.com/frankshearar/PersistentUnionFind/blob/master/Extensions/Dictionary.st -

!Dictionary methodsFor: '*PersistentUnionFind' stamp: 'fbs 1/2/2012 14:21'!
elementsOfClass: aParentObject
        ^ ((self associations
                select: [:assoc | (assoc value = aParentObject) or: [assoc key = aParentObject]]
                thenCollect: [:assoc | {assoc key. assoc value.}])
                        inject: #()
                        into: [:acc :each | acc , each]) asSet asArray! !
!

!Dictionary methodsFor: '*PersistentUnionFind' stamp: 'fbs 1/2/2012 13:57'!
elementsOfClass:: aParentObject
        ^ ((self associations
                select: [:assoc | (assoc value == aParentObject) or: [assoc key == aParentObject]]
                thenCollect: [:assoc | {assoc key. assoc value.}])
                        inject: #()
                        into: [:acc :each | acc , each]) asSet asArray! !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions