Chris Muller uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-cmm.101.mcz
==================== Summary ====================
Name: Files-cmm.101
Author: cmm
Time: 24 February 2011, 7:19:36.954 pm
UUID: 3463cdfa-5a3c-4e33-8c70-22a5f5be61fa
Ancestors: Files-cmm.100
Added conventional and necessary type-checking to new DirectoryEntry>>#=.
=============== Diff against Files-cmm.100 ===============
Item was changed:
----- Method: DirectoryEntry>>= (in category 'testing') -----
= aDirectoryEntry
"Answer whether I am equivalent in all of my file-system attributes."
+ super = aDirectoryEntry ifTrue: [^ true].
+ self species = aDirectoryEntry species ifFalse: [^ false].
^ self containingDirectory = aDirectoryEntry containingDirectory
and: [self name = aDirectoryEntry name
and: [self modificationTime = aDirectoryEntry modificationTime
and: [self fileSize = aDirectoryEntry fileSize]]]!
Chris Muller uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-cmm.101.mcz
==================== Summary ====================
Name: Files-cmm.101
Author: cmm
Time: 24 February 2011, 7:19:36.954 pm
UUID: 3463cdfa-5a3c-4e33-8c70-22a5f5be61fa
Ancestors: Files-cmm.100
Added conventional and necessary type-checking to new DirectoryEntry>>#=.
=============== Diff against Files-cmm.100 ===============
Item was changed:
----- Method: DirectoryEntry>>= (in category 'testing') -----
= aDirectoryEntry
"Answer whether I am equivalent in all of my file-system attributes."
+ super = aDirectoryEntry ifTrue: [^ true].
+ self species = aDirectoryEntry species ifFalse: [^ false].
^ self containingDirectory = aDirectoryEntry containingDirectory
and: [self name = aDirectoryEntry name
and: [self modificationTime = aDirectoryEntry modificationTime
and: [self fileSize = aDirectoryEntry fileSize]]]!
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.427.mcz
==================== Summary ====================
Name: Collections-ul.427
Author: ul
Time: 24 February 2011, 2:42:16.909 pm
UUID: 40a987b8-4024-9e45-bdb9-ac0b0b888ad2
Ancestors: Collections-ul.426
OrderedCollection tweaks:
- optimized (bytecode + stack usage) #addFirst: and #addLast:
- removed the #asInteger send from #at:put:, because no other operations use it
- recategorized and commented #reset and #resetTo:
=============== Diff against Collections-ul.426 ===============
Item was changed:
----- Method: OrderedCollection>>addFirst: (in category 'adding') -----
addFirst: newObject
"Add newObject to the beginning of the receiver. Answer newObject."
+ firstIndex = 1 ifTrue: [ self makeRoomAtFirst ].
+ ^array at: (firstIndex := firstIndex - 1) put: newObject!
- firstIndex = 1 ifTrue: [self makeRoomAtFirst].
- firstIndex := firstIndex - 1.
- array at: firstIndex put: newObject.
- ^ newObject!
Item was changed:
----- Method: OrderedCollection>>addLast: (in category 'adding') -----
addLast: newObject
"Add newObject to the end of the receiver. Answer newObject."
+ array size = lastIndex ifTrue: [ self makeRoomAtLast ].
+ ^array at: (lastIndex := lastIndex + 1) put: newObject!
- lastIndex = array size ifTrue: [self makeRoomAtLast].
- lastIndex := lastIndex + 1.
- array at: lastIndex put: newObject.
- ^ newObject!
Item was changed:
----- Method: OrderedCollection>>at:put: (in category 'accessing') -----
at: anInteger put: anObject
"Put anObject at element index anInteger. at:put: cannot be used to
append, front or back, to an ordered collection; it is used by a
knowledgeable client to replace an element."
+ (anInteger < 1 or: [anInteger + firstIndex - 1 > lastIndex])
- | index |
- index := anInteger asInteger.
- (index < 1 or: [index + firstIndex - 1 > lastIndex])
ifTrue: [self errorNoSuchElement]
+ ifFalse: [^array at: anInteger + firstIndex - 1 put: anObject]!
- ifFalse: [^array at: index + firstIndex - 1 put: anObject]!
Item was changed:
+ ----- Method: OrderedCollection>>reset (in category 'removing') -----
- ----- Method: OrderedCollection>>reset (in category 'private') -----
reset
+ "Quickly remove all elements. The objects will be still referenced, but will not be accessible."
+
-
self resetTo: 1!
Item was changed:
+ ----- Method: OrderedCollection>>resetTo: (in category 'removing') -----
- ----- Method: OrderedCollection>>resetTo: (in category 'private') -----
resetTo: index
+ "Quickly remove all elements. The objects will be still referenced, but will not be accessible. Also make sure that the first object will be inserted at index. Choosing the right value has had great impact on performance, but it's neglible with the current implementation, so it's better to use #reset instead in most cases."
+
firstIndex := index.
lastIndex := firstIndex - 1!
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.427.mcz
==================== Summary ====================
Name: Collections-ul.427
Author: ul
Time: 24 February 2011, 2:42:16.909 pm
UUID: 40a987b8-4024-9e45-bdb9-ac0b0b888ad2
Ancestors: Collections-ul.426
OrderedCollection tweaks:
- optimized (bytecode + stack usage) #addFirst: and #addLast:
- removed the #asInteger send from #at:put:, because no other operations use it
- recategorized and commented #reset and #resetTo:
=============== Diff against Collections-ul.426 ===============
Item was changed:
----- Method: OrderedCollection>>addFirst: (in category 'adding') -----
addFirst: newObject
"Add newObject to the beginning of the receiver. Answer newObject."
+ firstIndex = 1 ifTrue: [ self makeRoomAtFirst ].
+ ^array at: (firstIndex := firstIndex - 1) put: newObject!
- firstIndex = 1 ifTrue: [self makeRoomAtFirst].
- firstIndex := firstIndex - 1.
- array at: firstIndex put: newObject.
- ^ newObject!
Item was changed:
----- Method: OrderedCollection>>addLast: (in category 'adding') -----
addLast: newObject
"Add newObject to the end of the receiver. Answer newObject."
+ array size = lastIndex ifTrue: [ self makeRoomAtLast ].
+ ^array at: (lastIndex := lastIndex + 1) put: newObject!
- lastIndex = array size ifTrue: [self makeRoomAtLast].
- lastIndex := lastIndex + 1.
- array at: lastIndex put: newObject.
- ^ newObject!
Item was changed:
----- Method: OrderedCollection>>at:put: (in category 'accessing') -----
at: anInteger put: anObject
"Put anObject at element index anInteger. at:put: cannot be used to
append, front or back, to an ordered collection; it is used by a
knowledgeable client to replace an element."
+ (anInteger < 1 or: [anInteger + firstIndex - 1 > lastIndex])
- | index |
- index := anInteger asInteger.
- (index < 1 or: [index + firstIndex - 1 > lastIndex])
ifTrue: [self errorNoSuchElement]
+ ifFalse: [^array at: anInteger + firstIndex - 1 put: anObject]!
- ifFalse: [^array at: index + firstIndex - 1 put: anObject]!
Item was changed:
+ ----- Method: OrderedCollection>>reset (in category 'removing') -----
- ----- Method: OrderedCollection>>reset (in category 'private') -----
reset
+ "Quickly remove all elements. The objects will be still referenced, but will not be accessible."
+
-
self resetTo: 1!
Item was changed:
+ ----- Method: OrderedCollection>>resetTo: (in category 'removing') -----
- ----- Method: OrderedCollection>>resetTo: (in category 'private') -----
resetTo: index
+ "Quickly remove all elements. The objects will be still referenced, but will not be accessible. Also make sure that the first object will be inserted at index. Choosing the right value has had great impact on performance, but it's neglible with the current implementation, so it's better to use #reset instead in most cases."
+
firstIndex := index.
lastIndex := firstIndex - 1!
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.427.mcz
==================== Summary ====================
Name: Collections-ul.427
Author: ul
Time: 24 February 2011, 2:42:16.909 pm
UUID: 40a987b8-4024-9e45-bdb9-ac0b0b888ad2
Ancestors: Collections-ul.426
OrderedCollection tweaks:
- optimized (bytecode + stack usage) #addFirst: and #addLast:
- removed the #asInteger send from #at:put:, because no other operations use it
- recategorized and commented #reset and #resetTo:
=============== Diff against Collections-ul.426 ===============
Item was changed:
----- Method: OrderedCollection>>addFirst: (in category 'adding') -----
addFirst: newObject
"Add newObject to the beginning of the receiver. Answer newObject."
+ firstIndex = 1 ifTrue: [ self makeRoomAtFirst ].
+ ^array at: (firstIndex := firstIndex - 1) put: newObject!
- firstIndex = 1 ifTrue: [self makeRoomAtFirst].
- firstIndex := firstIndex - 1.
- array at: firstIndex put: newObject.
- ^ newObject!
Item was changed:
----- Method: OrderedCollection>>addLast: (in category 'adding') -----
addLast: newObject
"Add newObject to the end of the receiver. Answer newObject."
+ array size = lastIndex ifTrue: [ self makeRoomAtLast ].
+ ^array at: (lastIndex := lastIndex + 1) put: newObject!
- lastIndex = array size ifTrue: [self makeRoomAtLast].
- lastIndex := lastIndex + 1.
- array at: lastIndex put: newObject.
- ^ newObject!
Item was changed:
----- Method: OrderedCollection>>at:put: (in category 'accessing') -----
at: anInteger put: anObject
"Put anObject at element index anInteger. at:put: cannot be used to
append, front or back, to an ordered collection; it is used by a
knowledgeable client to replace an element."
+ (anInteger < 1 or: [anInteger + firstIndex - 1 > lastIndex])
- | index |
- index := anInteger asInteger.
- (index < 1 or: [index + firstIndex - 1 > lastIndex])
ifTrue: [self errorNoSuchElement]
+ ifFalse: [^array at: anInteger + firstIndex - 1 put: anObject]!
- ifFalse: [^array at: index + firstIndex - 1 put: anObject]!
Item was changed:
+ ----- Method: OrderedCollection>>reset (in category 'removing') -----
- ----- Method: OrderedCollection>>reset (in category 'private') -----
reset
+ "Quickly remove all elements. The objects will be still referenced, but will not be accessible."
+
-
self resetTo: 1!
Item was changed:
+ ----- Method: OrderedCollection>>resetTo: (in category 'removing') -----
- ----- Method: OrderedCollection>>resetTo: (in category 'private') -----
resetTo: index
+ "Quickly remove all elements. The objects will be still referenced, but will not be accessible. Also make sure that the first object will be inserted at index. Choosing the right value has had great impact on performance, but it's neglible with the current implementation, so it's better to use #reset instead in most cases."
+
firstIndex := index.
lastIndex := firstIndex - 1!
Chris Muller uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-cmm.100.mcz
==================== Summary ====================
Name: Files-cmm.100
Author: cmm
Time: 23 February 2011, 11:03:18.483 am
UUID: d88b3b47-ca8c-4a6a-8ad4-b7ba0f1ceba7
Ancestors: Files-ul.99
- DirectoryEntry's are very transient objects, so it makes sense for them to override #= and #hash, just like its brother, FileDirectory.
- Also added localized splitNameVersionExtension.
=============== Diff against Files-ul.99 ===============
Item was added:
+ ----- Method: DirectoryEntry>>= (in category 'testing') -----
+ = aDirectoryEntry
+ "Answer whether I am equivalent in all of my file-system attributes."
+ ^ self containingDirectory = aDirectoryEntry containingDirectory
+ and: [self name = aDirectoryEntry name
+ and: [self modificationTime = aDirectoryEntry modificationTime
+ and: [self fileSize = aDirectoryEntry fileSize]]]!
Item was added:
+ ----- Method: DirectoryEntry>>exists (in category 'testing') -----
+ exists
+ ^ (self containingDirectory
+ entryAt: self name
+ ifAbsent: [ nil ]) notNil!
Item was added:
+ ----- Method: DirectoryEntry>>hash (in category 'testing') -----
+ hash
+ "Hashing on directory + name should be sufficient."
+ ^ (self containingDirectory hash hashMultiply + self name hash) hashMultiply!
Item was added:
+ ----- Method: DirectoryEntry>>splitNameVersionExtension (in category 'access') -----
+ splitNameVersionExtension
+ " answer an array with the root name, version # and extension."
+ ^ self directory splitNameVersionExtensionFor: self name!
Chris Muller uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-cmm.100.mcz
==================== Summary ====================
Name: Files-cmm.100
Author: cmm
Time: 23 February 2011, 11:03:18.483 am
UUID: d88b3b47-ca8c-4a6a-8ad4-b7ba0f1ceba7
Ancestors: Files-ul.99
- DirectoryEntry's are very transient objects, so it makes sense for them to override #= and #hash, just like its brother, FileDirectory.
- Also added localized splitNameVersionExtension.
=============== Diff against Files-ul.99 ===============
Item was added:
+ ----- Method: DirectoryEntry>>= (in category 'testing') -----
+ = aDirectoryEntry
+ "Answer whether I am equivalent in all of my file-system attributes."
+ ^ self containingDirectory = aDirectoryEntry containingDirectory
+ and: [self name = aDirectoryEntry name
+ and: [self modificationTime = aDirectoryEntry modificationTime
+ and: [self fileSize = aDirectoryEntry fileSize]]]!
Item was added:
+ ----- Method: DirectoryEntry>>exists (in category 'testing') -----
+ exists
+ ^ (self containingDirectory
+ entryAt: self name
+ ifAbsent: [ nil ]) notNil!
Item was added:
+ ----- Method: DirectoryEntry>>hash (in category 'testing') -----
+ hash
+ "Hashing on directory + name should be sufficient."
+ ^ (self containingDirectory hash hashMultiply + self name hash) hashMultiply!
Item was added:
+ ----- Method: DirectoryEntry>>splitNameVersionExtension (in category 'access') -----
+ splitNameVersionExtension
+ " answer an array with the root name, version # and extension."
+ ^ self directory splitNameVersionExtensionFor: self name!
Chris Muller uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-cmm.100.mcz
==================== Summary ====================
Name: Files-cmm.100
Author: cmm
Time: 23 February 2011, 11:03:18.483 am
UUID: d88b3b47-ca8c-4a6a-8ad4-b7ba0f1ceba7
Ancestors: Files-ul.99
- DirectoryEntry's are very transient objects, so it makes sense for them to override #= and #hash, just like its brother, FileDirectory.
- Also added localized splitNameVersionExtension.
=============== Diff against Files-ul.99 ===============
Item was added:
+ ----- Method: DirectoryEntry>>= (in category 'testing') -----
+ = aDirectoryEntry
+ "Answer whether I am equivalent in all of my file-system attributes."
+ ^ self containingDirectory = aDirectoryEntry containingDirectory
+ and: [self name = aDirectoryEntry name
+ and: [self modificationTime = aDirectoryEntry modificationTime
+ and: [self fileSize = aDirectoryEntry fileSize]]]!
Item was added:
+ ----- Method: DirectoryEntry>>exists (in category 'testing') -----
+ exists
+ ^ (self containingDirectory
+ entryAt: self name
+ ifAbsent: [ nil ]) notNil!
Item was added:
+ ----- Method: DirectoryEntry>>hash (in category 'testing') -----
+ hash
+ "Hashing on directory + name should be sufficient."
+ ^ (self containingDirectory hash hashMultiply + self name hash) hashMultiply!
Item was added:
+ ----- Method: DirectoryEntry>>splitNameVersionExtension (in category 'access') -----
+ splitNameVersionExtension
+ " answer an array with the root name, version # and extension."
+ ^ self directory splitNameVersionExtensionFor: self name!