#REFACTORING by stefan cvs_MAIN
authorStefan Vogel <sv@exept.de>
Fri, 19 Jan 2018 22:42:30 +0100
branchcvs_MAIN
changeset 806 2b5c72c7b9d9
parent 803 73291d6b935a
child 811 b8d6e0d0e45e
#REFACTORING by stefan class: HGChangesetFile changed: #readingFileDo:
mercurial/HGChangesetFile.st
--- a/mercurial/HGChangesetFile.st	Wed Dec 06 03:34:16 2017 +0100
+++ b/mercurial/HGChangesetFile.st	Fri Jan 19 22:42:30 2018 +0100
@@ -399,52 +399,16 @@
      (old behavior, will vanish:)the block is evaluated with a nil argument.
      Ensures that the stream is closed."
 
-    |stream result|
+    |stream|
 
     stream := self readStream.
-    [
-        result := aBlock value:stream
+    ^ [
+        aBlock value:stream
     ] ensure:[
         stream notNil ifTrue:[stream close]
     ].
-    ^ result
 
-    "
-     read the first line from some file:
-
-     |rslt|
-
-     rslt := 
-        '/etc/passwd' asFilename 
-            readingFileDo:[:s |
-                s nextLine
-            ]. 
-     Transcript showCR:rslt.
-    "
-
-    "
-     find all used shells in /etc/passwd and count their usage:
-
-     |rslt|
-
-     rslt :=
-        '/etc/passwd' asFilename 
-            readingFileDo:
-                [:s |
-                    |shells|
-
-                    shells := Bag new.
-                    s linesDo:
-                        [:line |
-                            |parts|
-
-                            parts := line asCollectionOfSubstringsSeparatedBy:$:.
-                            shells add:(parts seventh).
-                        ].
-                    shells contents
-                ].           
-     Transcript showCR:rslt.
-    "
+    "Modified (comment): / 12-01-2018 / 18:23:20 / stefan"
 !
 
 readingLinesDo:aBlock