[squeak-dev] The Inbox: Chronology-Core-cbc.10.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 16 00:24:11 UTC 2017


A new version of Chronology-Core was added to project The Inbox:
http://source.squeak.org/inbox/Chronology-Core-cbc.10.mcz

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

Name: Chronology-Core-cbc.10
Author: cbc
Time: 15 June 2017, 5:24:03.228466 pm
UUID: 89e0d1fb-ce97-1a43-aa4b-d3c735c3bb2e
Ancestors: Chronology-Core-pre.9

Cache TimeZones.
Also, fix comment on TimeZone class>>default.

=============== Diff against Chronology-Core-pre.9 ===============

Item was changed:
  Object subclass: #TimeZone
  	instanceVariableNames: 'offset abbreviation name'
+ 	classVariableNames: 'TimeZones'
- 	classVariableNames: ''
  	poolDictionaries: 'ChronologyConstants'
  	category: 'Chronology-Core'!
  
  !TimeZone commentStamp: 'dtl 7/11/2009 15:03' prior: 0!
  TimeZone is a simple class to colect the information identifying a UTC time zone.
  
  offset			-	Duration	- the time zone's offset from UTC
  abbreviation	-	String		- the abbreviated name for the time zone.
  name			-	String		- the name of the time zone.
  
  TimeZone class >> #timeZones returns an array of the known time zones
  TimeZone class >> #default returns the default time zone (Grenwich Mean Time)
  !

Item was changed:
  ----- Method: TimeZone class>>default (in category 'accessing') -----
  default
+ 	"Answer the default time zone - UTC"
- 	"Answer the default time zone - GMT"
- 
  	^ self timeZones detect: [ :tz | tz offset = Duration zero ]!

Item was added:
+ ----- Method: TimeZone class>>initialize (in category 'class initialization') -----
+ initialize
+ 	TimeZones := Dictionary new.
+ !

Item was changed:
  ----- Method: TimeZone class>>offset:name:abbreviation: (in category 'instance creation') -----
  offset: aDuration name: aName abbreviation: anAbbreviation
+ 	^TimeZones at: { aDuration. aName. anAbbreviation. } ifAbsentPut: [
+ 		self new
+ 			offset: aDuration;
+ 			name: aName;
+ 			abbreviation: anAbbreviation;
+ 			yourself
+ 		]
- 
- 	^ self new
- 		offset: aDuration;
- 		name: aName;
- 		abbreviation: anAbbreviation;
- 		yourself
  !



More information about the Squeak-dev mailing list