[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sc-devel] Fwd: SF.net SVN: supercollider: [6766] trunk/build/SCClassLibrary/Common/ Collections/Dictionary.sc



Anfang der weitergeleiteten E-Mail:

Von: sc-devel-owner@xxxxxxxxxxxxxxx
Datum: 6. Dezember 2007 16:52:11 MEZ
An: sciss@xxxxxxxxxxxxxxxxxxxxx
Betreff: SF.net SVN: supercollider: [6766] trunk/build/ SCClassLibrary/Common/ Collections/Dictionary.sc

You are not allowed to post to this mailing list, and your message has
been automatically rejected.  If you think that your messages are
being rejected in error, contact the mailing list owner at
sc-devel-owner@xxxxxxxxxxxxxxxx
Von: sciss@xxxxxxxxxxxxxxxxxxxxx
Datum: 6. Dezember 2007 16:52:09 MEZ
An: sc-dev@xxxxxxxxxxxxxxx
Betreff: SF.net SVN: supercollider: [6766] trunk/build/ SCClassLibrary/Common/ Collections/Dictionary.sc


Revision: 6766
          http://svn.sourceforge.net/supercollider/?rev=6766&view=rev
Author:   sciss
Date:     2007-12-06 07:52:09 -0800 (Thu, 06 Dec 2007)

Log Message:
-----------
includesKey in Dictionary and IdentityDictionary use the 'at' method (much faster). Removed wrong second argument in IdentityDictionary:at

Modified Paths:
--------------
    trunk/build/SCClassLibrary/Common/Collections/Dictionary.sc

Modified: trunk/build/SCClassLibrary/Common/Collections/Dictionary.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Collections/Dictionary.sc 2007-12-06 11:51:34 UTC (rev 6765) +++ trunk/build/SCClassLibrary/Common/Collections/Dictionary.sc 2007-12-06 15:52:09 UTC (rev 6766)
@@ -87,9 +87,8 @@
 		this.do({ arg item2; if (item1 == item2, {^true}) });
 		^false
 	}
-	includesKey { arg item1;
-		this.keysDo({ arg item2; if (item1 == item2, {^true}) });
-		^false
+	includesKey { arg key;
+		^this.at( key ).notNil;
 	}
 	
 	// removing
@@ -333,7 +332,7 @@
 		^super.new(n).proto_(proto).parent_(parent).know_(know)
 	}
 	
-	at { arg key, value;
+	at { arg key;
 		_IdentDict_At
 		^this.primitiveFailed
 		/*^array.at(this.scanFor(key) + 1)*/
@@ -370,10 +369,10 @@
 		*/
 	}
 	
-	includesKey { arg item1;
-		this.keysDo({ arg item2; if (item1 === item2, {^true}) });
-		^false
+	includesKey { arg key;
+		^this.at( key ).notNil;
 	}
+
 	findKeyForValue { arg argValue;
 		this.keysValuesArrayDo(array, { arg key, val, i;
 			if (argValue === val, { ^key })


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.