#TUNING by stefan
authorStefan Vogel <sv@exept.de>
Tue, 27 Feb 2018 14:34:49 +0100
changeset 22558 2b3bb4038438
parent 22557 2d92bc17b35d
child 22559 ff1a09a98286
#TUNING by stefan class: Class changed: #localSourceStreamFor: save garbage
Class.st
--- a/Class.st	Tue Feb 27 12:04:27 2018 +0100
+++ b/Class.st	Tue Feb 27 14:34:49 2018 +0100
@@ -3475,7 +3475,6 @@
     "Modified: / 05-07-2017 / 10:50:57 / cg"
 ! !
 
-
 !Class methodsFor:'printOut'!
 
 htmlDocumentation
@@ -4709,54 +4708,54 @@
     "/
     fileName := Smalltalk getSourceFileName:sourceFile.
     fileName notNil ifTrue:[
-	^ fileName asFilename readStreamOrNil.
+        ^ fileName asFilename readStreamOrNil.
     ].
 
     (package := self package) notNil ifTrue:[
-	"/ newest scheme ...
-	packageDir := Smalltalk findPackageDirectoryForPackage:package.
-	packageDir notNil ifTrue:[
-	    "/ present there ?
-	    packageDir := packageDir asFilename.
-	    (fn := packageDir construct:sourceFile) exists ifTrue:[
-		^ fn readStreamOrNil.
-	    ].
-
-	    "/ a source subdirectory ?
-	    fn := (packageDir construct:'source') construct:sourceFile.
-	    fn exists ifTrue:[
-		^ fn readStreamOrNil.
-	    ].
-
-	    "/ a zip-file ?
-	    fn := (packageDir construct:'source.zip').
-	    fn exists ifTrue:[
-		zar := ZipArchive oldFileNamed:fn.
-		zar notNil ifTrue:[
-		    entry := zar extract:sourceFile.
-		    entry notNil ifTrue:[
-			^ entry asString readStream
-		    ]
-		]
-	    ]
-	].
-
-	"/ will vanish ...
-	(package includes:$:) ifTrue:[
-	    package := package asString copyReplaceAll:$: with:$/
-	] ifFalse:[
-	    package := 'stx/' , package
-	].
-	fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile).
-	fileName notNil ifTrue:[
-	    ^ fileName asFilename readStreamOrNil.
-	].
-	(package startsWith:'stx/') ifTrue:[
-	    fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile).
-	    fileName notNil ifTrue:[
-		^ fileName asFilename readStreamOrNil.
-	    ]
-	]
+        "/ newest scheme ...
+        packageDir := Smalltalk findPackageDirectoryForPackage:package.
+        packageDir notNil ifTrue:[
+            "/ present there ?
+            packageDir := packageDir asFilename.
+            (fn := packageDir construct:sourceFile) exists ifTrue:[
+                ^ fn readStreamOrNil.
+            ].
+
+            "/ a source subdirectory ?
+            fn := (packageDir construct:'source') construct:sourceFile.
+            fn exists ifTrue:[
+                ^ fn readStreamOrNil.
+            ].
+
+            "/ a zip-file ?
+            fn := (packageDir construct:'source.zip').
+            fn exists ifTrue:[
+                zar := ZipArchive oldFileNamed:fn.
+                zar notNil ifTrue:[
+                    entry := zar extract:sourceFile asString:true.
+                    entry notNil ifTrue:[
+                        ^ entry readStream
+                    ]
+                ]
+            ]
+        ].
+
+        "/ will vanish ...
+        (package includes:$:) ifTrue:[
+            package := package asString copyReplaceAll:$: with:$/
+        ] ifFalse:[
+            package := 'stx/' , package
+        ].
+        fileName := Smalltalk getSourceFileName:(package , '/' , sourceFile).
+        fileName notNil ifTrue:[
+            ^ fileName asFilename readStreamOrNil.
+        ].
+        (package startsWith:'stx/') ifTrue:[
+            fileName := Smalltalk getSourceFileName:((package copyFrom:5) , '/' , sourceFile).
+            fileName notNil ifTrue:[
+                ^ fileName asFilename readStreamOrNil.
+            ]
+        ]
     ].
 
     "/
@@ -4765,49 +4764,50 @@
     "/ obsolete.
     info := self packageSourceCodeInfo.
     info notNil ifTrue:[
-	module := info at:#module ifAbsent:nil.
-	module notNil ifTrue:[
-	    dir := info at:#directory ifAbsent:nil.
-	    dir notNil ifTrue:[
-		fn := (module asFilename construct:dir) construct:sourceFile.
-		fileName := Smalltalk getSourceFileName:(fn name).
-		fileName notNil ifTrue:[
-		    ^ fileName asFilename readStreamOrNil.
-		].
-
-		"/ brand new: look for source/<module>/package.zip
-		"/ containing an entry for <filename>
-
-		fn := (module asFilename construct:dir) withSuffix:'zip'.
-		fileName := Smalltalk getSourceFileName:(fn name).
-		fileName notNil ifTrue:[
-		    zar := ZipArchive oldFileNamed:fileName.
-		    zar notNil ifTrue:[
-			entry := zar extract:sourceFile.
-			entry notNil ifTrue:[
-			    ^ entry asString readStream
-			]
-		    ]
-		].
-
-		"/ and also in source/source.zip ...
-
-		fileName := Smalltalk getSourceFileName:'source.zip'.
-		fileName notNil ifTrue:[
-		    zar := ZipArchive oldFileNamed:fileName.
-		    zar notNil ifTrue:[
-			entry := zar extract:sourceFile.
-			entry notNil ifTrue:[
-			    ^ entry asString readStream
-			]
-		    ]
-		].
-	    ]
-	]
+        module := info at:#module ifAbsent:nil.
+        module notNil ifTrue:[
+            dir := info at:#directory ifAbsent:nil.
+            dir notNil ifTrue:[
+                fn := (module asFilename construct:dir) construct:sourceFile.
+                fileName := Smalltalk getSourceFileName:(fn name).
+                fileName notNil ifTrue:[
+                    ^ fileName asFilename readStreamOrNil.
+                ].
+
+                "/ brand new: look for source/<module>/package.zip
+                "/ containing an entry for <filename>
+
+                fn := (module asFilename construct:dir) withSuffix:'zip'.
+                fileName := Smalltalk getSourceFileName:(fn name).
+                fileName notNil ifTrue:[
+                    zar := ZipArchive oldFileNamed:fileName.
+                    zar notNil ifTrue:[
+                        entry := zar extract:sourceFile asString:true.
+                        entry notNil ifTrue:[
+                            ^ entry readStream
+                        ]
+                    ]
+                ].
+
+                "/ and also in source/source.zip ...
+
+                fileName := Smalltalk getSourceFileName:'source.zip'.
+                fileName notNil ifTrue:[
+                    zar := ZipArchive oldFileNamed:fileName.
+                    zar notNil ifTrue:[
+                        entry := zar extract:sourceFile asString:true.
+                        entry notNil ifTrue:[
+                            ^ entry readStream
+                        ]
+                    ]
+                ].
+            ]
+        ]
     ].
     ^ nil
 
-    "Modified: / 18.7.1998 / 22:53:19 / cg"
+    "Modified: / 18-07-1998 / 22:53:19 / cg"
+    "Modified: / 27-02-2018 / 14:22:18 / stefan"
 !
 
 nameOfOldVersionMethod