X Tutup
Skip to content

Commit 65b8f07

Browse files
committed
Small optimizations
A couple of small optimizations
1 parent 90ef167 commit 65b8f07

File tree

6 files changed

+23
-15
lines changed

6 files changed

+23
-15
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*grease-core
2+
greaseString
3+
^ self
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"instance" : {
3-
"pluralize" : "jf 9/30/2009 00:37",
43
"excerpt:" : "lr 10/25/2009 11:19",
54
"excerpt:radius:" : "lr 10/25/2009 11:19",
5+
"greaseString" : "pmm 9/8/2017 13:45",
66
"truncate" : "lr 10/25/2009 11:17",
7-
"truncate:" : "lr 10/25/2009 11:17",
8-
"truncate:ellipsis:" : "lr 2/7/2008 09:22",
7+
"excerpt:radius:ellipsis:" : "jf 12/17/2009 10:49",
98
"greaseInteger" : "pmm 8/25/2016 14:02",
109
"print:on:" : "lr 7/24/2008 18:19",
11-
"excerpt:radius:ellipsis:" : "jf 12/17/2009 10:49"
10+
"pluralize" : "jf 9/30/2009 00:37",
11+
"truncate:" : "lr 10/25/2009 11:17",
12+
"truncate:ellipsis:" : "lr 2/7/2008 09:22"
1213
},
1314
"class" : { }
1415
}

repository/Grease-Core.package/monticello.meta/version

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
streaming
22
nextPut: aCharacter
3-
| codePoint shouldEncode |
3+
| codePoint |
44
codePoint := aCharacter codePoint.
5-
codePoint > 255
6-
ifTrue: [ ^ self nextPutAll: (String with: aCharacter) ].
7-
shouldEncode := Latin1ToUtf8Map at: codePoint + 1.
8-
shouldEncode = 1
9-
ifTrue: [ stream nextPutAll: (Latin1ToUtf8Encodings at: codePoint + 1) ]
10-
ifFalse: [ stream nextPut: aCharacter ]
5+
codePoint < 128 ifTrue: [
6+
^ stream nextPut: aCharacter ].
7+
codePoint < 256 ifTrue: [
8+
| shouldEncode |
9+
shouldEncode := Latin1ToUtf8Map at: codePoint + 1.
10+
^ shouldEncode = 1
11+
ifTrue: [ stream nextPutAll: (Latin1ToUtf8Encodings at: codePoint + 1) ]
12+
ifFalse: [ stream nextPut: aCharacter ] ].
13+
14+
^ self nextPutAll: (String with: aCharacter)
1115

repository/Grease-Pharo60-Core.package/GRPharoUtf8CodecStream.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"greaseNext:putAllFast:startingAt:" : "pmm 5/21/2014 21:28",
77
"greaseNext:putAll:startingAt:" : "pmm 8/15/2011 21:32",
88
"encodeDefault:" : "lr 7/25/2011 18:36",
9-
"nextPut:" : "lr 7/25/2011 19:51",
9+
"nextPut:" : "pmm 9/7/2017 14:47",
1010
"nextPutAll:" : "pmm 4/10/2010 13:28",
1111
"next:" : "pmm 8/25/2016 11:00",
1212
"encodeFast:" : "pmm 8/25/2016 11:00"

repository/Grease-Pharo60-Core.package/monticello.meta/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(name 'Grease-Pharo60-Core-pmm.6' message 'Add thisContext method to GRPlatform' id 'b01ff64f-d114-0d00-9d20-ac690c6d599d' date '5 September 2017' time '1:31:59.489145 pm' author 'pmm' ancestors ((name 'Grease-Pharo60-Core-pmm.5' message 'Add comments to classes who were previously missing them.' id '3f01c4b7-cc14-0d00-9c48-5d25066d8f9e' date '5 September 2017' time '8:03:06.198613 am' author 'pmm' ancestors ((name 'Grease-Pharo60-Core-pmm.4' message 'Kick explorer support from Pharo 6- Closes #31' id 'f1e4d024-cc14-0d00-9c47-1a66066d8f9e' date '5 September 2017' time '7:22:00.792553 am' author 'pmm' ancestors ((name 'Grease-Pharo60-Core-JohanBrichau.3' message 'Added GRDynamicVariable class>>defaultValue to represent the default value of a GRDynamicVariable. Previously, this was GRDynamicvariable>>default but this was not compatible for all platforms' id 'b7f896c0-5f11-0d00-87f2-d9cb08c307d1' date '23 July 2017' time '5:47:27.925141 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo60-Core-JohanBrichau.2' message 'Added GRDynamicVariable (copied from Grease-Pharo30-Core-MaxLeske.23)' id 'c95f31f1-ba0c-0d00-9a91-77be09e6dcd5' date '25 May 2017' time '3:29:07.233987 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo60-Core-JohanBrichau.1' message 'Split from Grease-Pharo30-Core-PavelKrivanek.22with changes for Pharo6.0 onwards' id 'fec0f92f-b80c-0d00-b4b4-c13800bfc9db' date '25 May 2017' time '12:11:55.651574 pm' author 'JohanBrichau' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
1+
(name 'Grease-Pharo60-Core-pmm.7' message 'Small optimization- avoid table lookup in common case' id 'b99d6b17-1115-0d00-9402-d53004aeb9ca' date '8 September 2017' time '5:37:28.7948 pm' author 'pmm' ancestors ((name 'Grease-Pharo60-Core-pmm.6' message 'Add thisContext method to GRPlatform' id 'b01ff64f-d114-0d00-9d20-ac690c6d599d' date '5 September 2017' time '1:31:59.489145 pm' author 'pmm' ancestors ((name 'Grease-Pharo60-Core-pmm.5' message 'Add comments to classes who were previously missing them.' id '3f01c4b7-cc14-0d00-9c48-5d25066d8f9e' date '5 September 2017' time '8:03:06.198613 am' author 'pmm' ancestors ((name 'Grease-Pharo60-Core-pmm.4' message 'Kick explorer support from Pharo 6- Closes #31' id 'f1e4d024-cc14-0d00-9c47-1a66066d8f9e' date '5 September 2017' time '7:22:00.792553 am' author 'pmm' ancestors ((name 'Grease-Pharo60-Core-JohanBrichau.3' message 'Added GRDynamicVariable class>>defaultValue to represent the default value of a GRDynamicVariable. Previously, this was GRDynamicvariable>>default but this was not compatible for all platforms' id 'b7f896c0-5f11-0d00-87f2-d9cb08c307d1' date '23 July 2017' time '5:47:27.925141 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo60-Core-JohanBrichau.2' message 'Added GRDynamicVariable (copied from Grease-Pharo30-Core-MaxLeske.23)' id 'c95f31f1-ba0c-0d00-9a91-77be09e6dcd5' date '25 May 2017' time '3:29:07.233987 pm' author 'JohanBrichau' ancestors ((name 'Grease-Pharo60-Core-JohanBrichau.1' message 'Split from Grease-Pharo30-Core-PavelKrivanek.22with changes for Pharo6.0 onwards' id 'fec0f92f-b80c-0d00-b4b4-c13800bfc9db' date '25 May 2017' time '12:11:55.651574 pm' author 'JohanBrichau' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())

0 commit comments

Comments
 (0)
X Tutup