Browse Source

More method comments in Set

Nicolas Petton 11 years ago
parent
commit
5e0723a919
2 changed files with 9 additions and 8 deletions
  1. 4 4
      js/Kernel-Collections.js
  2. 5 4
      st/Kernel-Collections.st

+ 4 - 4
js/Kernel-Collections.js

@@ -5567,13 +5567,13 @@ return smalltalk.withContext(function($ctx1) {
 		if ((type = typeof prim) === "object") {
 		if ((type = typeof prim) === "object") {
 			if (anObject !== nil) {
 			if (anObject !== nil) {
 				bucket = null;
 				bucket = null;
-				self['@slowBucketStores'].some(function (x) {
-					return bucket = x._bucketOfElement_(anObject);
+				self['@slowBucketStores'].some(function (store) {
+					return bucket = store._bucketOfElement_(anObject);
 				});
 				});
 				return [ anObject, null, bucket || self['@defaultBucket'] ];
 				return [ anObject, null, bucket || self['@defaultBucket'] ];
 			}
 			}
 			
 			
-			// include nil to well-knowns objects under 'boolean' fastBucket
+			// include nil to well-known objects under 'boolean' fastBucket
 			prim = null;
 			prim = null;
 			type = 'boolean';
 			type = 'boolean';
 		}
 		}
@@ -5581,7 +5581,7 @@ return smalltalk.withContext(function($ctx1) {
 	;
 	;
 return self}, function($ctx1) {$ctx1.fill(self,"bucketOfElement:",{anObject:anObject},smalltalk.Set)})},
 return self}, function($ctx1) {$ctx1.fill(self,"bucketOfElement:",{anObject:anObject},smalltalk.Set)})},
 args: ["anObject"],
 args: ["anObject"],
-source: "bucketOfElement: anObject\x0a\x09\x22Find the appropriate bucket for `anObject`\x22\x0a\x09\x0a\x09<\x0a\x09\x09var type, bucket, prim = anObject == null ? (anObject = nil) : anObject.valueOf();\x0a\x09\x09if ((type = typeof prim) === \x22object\x22) {\x0a\x09\x09\x09if (anObject !== nil) {\x0a\x09\x09\x09\x09bucket = null;\x0a\x09\x09\x09\x09self['@slowBucketStores'].some(function (x) {\x0a\x09\x09\x09\x09\x09return bucket = x._bucketOfElement_(anObject);\x0a\x09\x09\x09\x09});\x0a\x09\x09\x09\x09return [ anObject, null, bucket || self['@defaultBucket'] ];\x0a\x09\x09\x09}\x0a\x09\x09\x09\x0a\x09\x09\x09// include nil to well-knowns objects under 'boolean' fastBucket\x0a\x09\x09\x09prim = null;\x0a\x09\x09\x09type = 'boolean';\x0a\x09\x09}\x0a\x09\x09return [ prim, self['@fastBuckets'][type] ];\x0a\x09>",
+source: "bucketOfElement: anObject\x0a\x09\x22Find the appropriate bucket for `anObject`.\x0a\x09Answer an array with the object to be store, the primitive bucket, then the slow bucket\x22\x0a\x09\x0a\x09<\x0a\x09\x09var type, bucket, prim = anObject == null ? (anObject = nil) : anObject.valueOf();\x0a\x09\x09if ((type = typeof prim) === \x22object\x22) {\x0a\x09\x09\x09if (anObject !== nil) {\x0a\x09\x09\x09\x09bucket = null;\x0a\x09\x09\x09\x09self['@slowBucketStores'].some(function (store) {\x0a\x09\x09\x09\x09\x09return bucket = store._bucketOfElement_(anObject);\x0a\x09\x09\x09\x09});\x0a\x09\x09\x09\x09return [ anObject, null, bucket || self['@defaultBucket'] ];\x0a\x09\x09\x09}\x0a\x09\x09\x09\x0a\x09\x09\x09// include nil to well-known objects under 'boolean' fastBucket\x0a\x09\x09\x09prim = null;\x0a\x09\x09\x09type = 'boolean';\x0a\x09\x09}\x0a\x09\x09return [ prim, self['@fastBuckets'][type] ];\x0a\x09>",
 messageSends: [],
 messageSends: [],
 referencedClasses: []
 referencedClasses: []
 }),
 }),

+ 5 - 4
st/Kernel-Collections.st

@@ -1979,20 +1979,21 @@ add: anObject in: anotherObject
 !
 !
 
 
 bucketOfElement: anObject
 bucketOfElement: anObject
-	"Find the appropriate bucket for `anObject`"
+	"Find the appropriate bucket for `anObject`.
+	Answer an array with the object to be store, the primitive bucket, then the slow bucket"
 	
 	
 	<
 	<
 		var type, bucket, prim = anObject == null ? (anObject = nil) : anObject.valueOf();
 		var type, bucket, prim = anObject == null ? (anObject = nil) : anObject.valueOf();
 		if ((type = typeof prim) === "object") {
 		if ((type = typeof prim) === "object") {
 			if (anObject !!== nil) {
 			if (anObject !!== nil) {
 				bucket = null;
 				bucket = null;
-				self['@slowBucketStores'].some(function (x) {
-					return bucket = x._bucketOfElement_(anObject);
+				self['@slowBucketStores'].some(function (store) {
+					return bucket = store._bucketOfElement_(anObject);
 				});
 				});
 				return [ anObject, null, bucket || self['@defaultBucket'] ];
 				return [ anObject, null, bucket || self['@defaultBucket'] ];
 			}
 			}
 			
 			
-			// include nil to well-knowns objects under 'boolean' fastBucket
+			// include nil to well-known objects under 'boolean' fastBucket
 			prim = null;
 			prim = null;
 			type = 'boolean';
 			type = 'boolean';
 		}
 		}