[squeak-dev] The Trunk: Kernel-ul.1413.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Sep 13 18:12:16 UTC 2021


Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.1413.mcz

==================== Summary ====================

Name: Kernel-ul.1413
Author: ul
Time: 13 September 2021, 8:06:11.922907 pm
UUID: 2751b4f0-b45d-4578-b539-a3ccfd56d4ee
Ancestors: Kernel-ul.1412

- MethodDictionary must override #at:ifPresent:
- remove accidentally commited junk #isPowerOfTwo2 and #isPowerOfTwo3

=============== Diff against Kernel-ul.1412 ===============

Item was added:
+ ----- Method: MethodDictionary>>at:ifPresent: (in category 'accessing') -----
+ at: key ifPresent: aBlock
+ 	"Lookup the given key in the receiver. If it is present, answer the value of evaluating the given block with the value associated with the key. Otherwise, answer nil."
+ 
+ 	^(array at: (self scanFor: key)) ifNotNil: [ :value | aBlock value: value ]!

Item was removed:
- ----- Method: SmallInteger>>isPowerOfTwo2 (in category 'testing') -----
- isPowerOfTwo2
- 	"Return true if the receiver is an integral power of two. Optimized version."
- 	
- 	^self strictlyPositive and: [ (self bitAnd: self - 1) = 0 ]!

Item was removed:
- ----- Method: SmallInteger>>isPowerOfTwo3 (in category 'testing') -----
- isPowerOfTwo3
- 	"Return true if the receiver is an integral power of two. Optimized version."
- 	
- 	self > 0 ifFalse: [ ^false ].
- 	(self bitAnd: self - 1) = 0 ifFalse: [ ^false ].
- 	^true!



More information about the Squeak-dev mailing list