[squeak-dev] The Inbox: HelpSystem-Core-ct.125.mcz

Tobias Pape Das.Linux at gmx.de
Mon Oct 14 07:16:21 UTC 2019


Hi

I'd like to propose a little change:


> On 14.10.2019, at 00:34, commits at source.squeak.org wrote:
> 
>  ----- Method: ClassBasedHelpTopic>>contents (in category 'accessing') -----
>  contents
>  	"A book has no contents. Only its pages do."
>  	
> + 	^ self defaultSubtopic ifNil: [''] ifNotNil: #contents!

	^ self defaultSubtopic
		ifNotNil: [:topic | topic contents]
		ifNil: ['']

This changes the order so that the non-exceptional case is first. It also avoids the meta-level.


> - 	^ ''!
> 
> Item was added:
> + ----- Method: ClassBasedHelpTopic>>defaultSubtopic (in category 'accessing') -----
> + defaultSubtopic
> + 
> + 	^ self helpClass defaultPageKey
> + 		ifNotNil: [:key |
> + 			self subtopics
> + 				detect: [:topic | topic key = key]
> + 				ifNone: [nil]]
> + 		ifNil: [nil]!

I'd leave out the 'ifNil: [nil]' case; it's implied when sending ifNotNil:.

Best regards
	-Tobias


More information about the Squeak-dev mailing list