[squeak-dev] The Trunk: Monticello-ul.465.mcz

commits at source.squeak.org commits at source.squeak.org
Sun May 8 01:56:14 UTC 2011


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

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

Name: Monticello-ul.465
Author: ul
Time: 8 May 2011, 3:32:11.704 am
UUID: a19b6091-a426-8642-b178-65475e54e708
Ancestors: Monticello-ul.464

- fix duplicate entries in MC browsers, by replacing the "optimization" of MCFileBasedRepository >> #readableFileNames with one that actually works.

=============== Diff against Monticello-ul.464 ===============

Item was changed:
  ----- Method: MCFileBasedRepository>>readableFileNames (in category 'private-files') -----
  readableFileNames
  	"Answer an Array of MCVersionNames representing every file in this repository; first the ones from the cache (whether or not they still exist in the repository) followed by every other file in this repository that Monticello can read."
+ 	| all cached new |
- 	
- 	| all cached new hashes cachedSet |
  	all := self allFileNamesOrCache.	"from repository"
  	cached := self cachedFileNames.	"in memory"
+ 	"Create a sparse Set, so we can avoid #= for MCVersionNames during the difference calculation."
+ 	new := all difference: (
+ 		(Set new: (cached size * 8 min: all size))
+ 			addAll: cached;
+ 			yourself).
- 	"The following is for caching the hashes of cached MCVersionNames."
- 	hashes := IdentityDictionary new: cached size.
- 	cached do: [ :each | hashes at: each put: each hash ].
- 	cachedSet := PluggableSet new: cached size.
- 	cachedSet hashBlock: [ :element | hashes at: element ifAbsent: [ 1 ] ].
- 	cachedSet addAll: cached.
- 	new := all difference: cachedSet.
  	^ (cached asArray, new)
  		select: [:ea | self canReadFileNamed: ea]!




More information about the Squeak-dev mailing list