The Trunk: Monticello-ul.726.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Monticello-ul.726.mcz

commits-2
Levente Uzonyi uploaded a new version of Monticello to project The Trunk:
http://source.squeak.org/trunk/Monticello-ul.726.mcz

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

Name: Monticello-ul.726
Author: ul
Time: 29 June 2020, 1:39:36.986367 am
UUID: b64f6b16-96de-40ed-aa9a-2c0f625bfcb1
Ancestors: Monticello-mt.725

- potentially speed up MCDirectoryRepository >> #includesVersionNamed: when the repository doesn't have version names cached
- cache self size in MCVersionName >> #versionName

=============== Diff against Monticello-mt.725 ===============

Item was added:
+ ----- Method: MCDirectoryRepository>>includesVersionNamed: (in category 'versions') -----
+ includesVersionNamed: aString
+
+ | comparable |
+ comparable := ((aString endsWith: '.mcz') and: [ aString size > 4 ])
+ ifTrue: [ aString allButLast: 4 ]
+ ifFalse: [ aString ].
+ allVersionNamesCache ifNil: [
+ "Instead of reading the contents of the entire directory in #allVersionNames, look up a single .mcz file.
+ This is just an optimization. If the file does not exist, the version may still be there as an mcd."
+ (directory fileExists: comparable, '.mcz') ifTrue: [ ^true ] ].
+ ^ self allVersionNames includes: comparable!

Item was changed:
  ----- Method: MCVersionName>>versionName (in category 'accessing') -----
  versionName
  "Answer my version name as a ByteString, without the file suffix or any ancestor-attributes."
  | end |
  self isEmpty ifTrue: [^ String empty].
  end := self indexOf: $( ifAbsent: [
+ | size |
+ size := self size.
+ (size > 4
+ and: [ (self at: size - 3) == $.
+ and: [ (self at: size - 2) == $m
+ and: [ (self at: size - 1) == $c ] ] ])
+ ifTrue: [size - 3]
+ ifFalse: [size + 1]].
- (self size > 4
- and: [ (self at: self size - 3) == $.
- and: [ (self at: self size - 2) == $m
- and: [ (self at: self size - 1) == $c ] ] ])
- ifTrue: [self size - 3]
- ifFalse: [self size + 1]].
  ^self first: end - 1!