Merge jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 04 Jul 2016 21:14:49 +0100
branchjv
changeset 20081 2961b4289773
parent 20080 093324d7a47c (current diff)
parent 20067 5817f13cb16d (diff)
child 20082 ea1059c10bba
Merge
Dictionary.st
Process.st
--- a/Dictionary.st	Fri Jul 01 15:31:10 2016 +0100
+++ b/Dictionary.st	Mon Jul 04 21:14:49 2016 +0100
@@ -192,14 +192,14 @@
 
     sz := keyArray size.
     newDict := self new:sz.
-    keyArray with:valueArray do:[:key :value |
-	newDict at:key put:value
+    1 to:sz do:[:index |
+        newDict at:(keyArray at:index) put:(valueArray at:index).
     ].
     ^ newDict
 
     "
      Dictionary withKeys:#('one' 'two' 'three' 'four')
-	       andValues:#(1 2 3 4)
+               andValues:#(1 2 3 4)
     "
 !
 
@@ -292,6 +292,8 @@
     ^ true
 ! !
 
+
+
 !Dictionary methodsFor:'accessing'!
 
 associationAt:aKey
@@ -2336,6 +2338,7 @@
     ^ aVisitor visitDictionary:self with:aParameter
 ! !
 
+
 !Dictionary class methodsFor:'documentation'!
 
 version
--- a/Process.st	Fri Jul 01 15:31:10 2016 +0100
+++ b/Process.st	Mon Jul 04 21:14:49 2016 +0100
@@ -2143,13 +2143,9 @@
     |var|
 
     environment isNil ifTrue:[
-	environment := IdentityDictionary new
+        environment := IdentityDictionary new
     ].
-    var := environment at:aKey ifAbsent:nil.
-    var isNil ifTrue:[
-	var := ValueHolder new.
-	environment at:aKey put:var.
-    ].
+    var := environment at:aKey ifAbsentPut:[ValueHolder new].
     var value:aValue.
     ^ aValue
 !
@@ -2157,8 +2153,7 @@
 environmentIncludesKey:aKey
     "true if there is a thread local variable, false if no such variable exists"
 
-    environment isNil ifTrue:[^ false].
-    ^ environment includesKey:aKey
+    ^ environment notNil and:[environment includesKey:aKey]
 !
 
 stderr