The Inbox: System-dtl.1118.mcz

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

The Inbox: System-dtl.1118.mcz

commits-2
David T. Lewis uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-dtl.1118.mcz

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

Name: System-dtl.1118
Author: dtl
Time: 9 November 2019, 2:13:04.993358 pm
UUID: 49b4ee31-b57f-4132-8cda-e13c2414f861
Ancestors: System-mt.1117

When reporting VM parameters, enable formatting in the case of a parameter value that is represented as a Float rather than an Integer. This may happen if a VM parameter is defined in units of milliseconds but internally measured to microsecond precision by the VM, in which case the value may be returned as a Float in order to retain full precision. SmalltalkImage>>formatVMParameter: handles the formatting for integer and non-integer values.

=============== Diff against System-mt.1117 ===============

Item was added:
+ ----- Method: SmalltalkImage>>formatVMParameter: (in category 'vm statistics') -----
+ formatVMParameter: aNumber
+
+ aNumber isFloat ifTrue: [
+ aNumber < 1000
+ ifTrue: [^ aNumber printShowingMaxDecimalPlaces: 5 ]
+ ifFalse: [^ aNumber rounded asStringWithCommas]].
+ ^ aNumber asInteger asStringWithCommas.!

Item was changed:
  ----- Method: SmalltalkImage>>vmStatisticsReportOn: (in category 'vm statistics') -----
(excessive size, no diff calculated)


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-dtl.1118.mcz

marcel.taeumel
Hi Dave.

> ...This may happen if...

That would be a nice in-method comment. :-)

Best,
Marcel

Am 09.11.2019 20:13:19 schrieb [hidden email] <[hidden email]>:

David T. Lewis uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-dtl.1118.mcz

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

Name: System-dtl.1118
Author: dtl
Time: 9 November 2019, 2:13:04.993358 pm
UUID: 49b4ee31-b57f-4132-8cda-e13c2414f861
Ancestors: System-mt.1117

When reporting VM parameters, enable formatting in the case of a parameter value that is represented as a Float rather than an Integer. This may happen if a VM parameter is defined in units of milliseconds but internally measured to microsecond precision by the VM, in which case the value may be returned as a Float in order to retain full precision. SmalltalkImage>>formatVMParameter: handles the formatting for integer and non-integer values.

=============== Diff against System-mt.1117 ===============

Item was added:
+ ----- Method: SmalltalkImage>>formatVMParameter: (in category 'vm statistics') -----
+ formatVMParameter: aNumber
+
+ aNumber isFloat ifTrue: [
+ aNumber <>
+ ifTrue: [^ aNumber printShowingMaxDecimalPlaces: 5 ]
+ ifFalse: [^ aNumber rounded asStringWithCommas]].
+ ^ aNumber asInteger asStringWithCommas.!

Item was changed:
----- Method: SmalltalkImage>>vmStatisticsReportOn: (in category 'vm statistics') -----
(excessive size, no diff calculated)




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: System-dtl.1118.mcz

Chris Muller-3
In reply to this post by commits-2
Just a couple of picky readability comments:     :)

  - IMO, the last line wrapped in an ifFalse: would allow removing three returns for one single return at the top of the method, allowing an easier hierarchical representation of the logic.
  - Comparing to 1000.0 instead of 1000 would provide a little better contextual readability.

Best,
  Chris



On Sat, Nov 9, 2019 at 1:13 PM <[hidden email]> wrote:
David T. Lewis uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-dtl.1118.mcz

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

Name: System-dtl.1118
Author: dtl
Time: 9 November 2019, 2:13:04.993358 pm
UUID: 49b4ee31-b57f-4132-8cda-e13c2414f861
Ancestors: System-mt.1117

When reporting VM parameters, enable formatting in the case of a parameter value that is represented as a Float rather than an Integer. This may happen if a VM parameter is defined in units of milliseconds but internally measured to microsecond precision by the VM, in which case the value may be returned as a Float in order to retain full precision. SmalltalkImage>>formatVMParameter: handles the formatting for integer and non-integer values.

=============== Diff against System-mt.1117 ===============

Item was added:
+ ----- Method: SmalltalkImage>>formatVMParameter: (in category 'vm statistics') -----
+ formatVMParameter: aNumber
+
+       aNumber isFloat ifTrue: [
+               aNumber < 1000
+                       ifTrue: [^ aNumber printShowingMaxDecimalPlaces: 5 ]
+                       ifFalse: [^ aNumber rounded asStringWithCommas]].
+       ^ aNumber asInteger asStringWithCommas.!

Item was changed:
  ----- Method: SmalltalkImage>>vmStatisticsReportOn: (in category 'vm statistics') -----
(excessive size, no diff calculated)