[29756] users/rhwood/MacPorts.Framework

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 8 12:25:37 PDT 2007


Revision: 29756
          http://trac.macosforge.org/projects/macports/changeset/29756
Author:   rhwood at macports.org
Date:     2007-10-08 12:25:37 -0700 (Mon, 08 Oct 2007)

Log Message:
-----------
Add method mutableDictionaryFromTclListAsString to return a NSMutableDictionary and use it for the heavy lifting in method dictionaryFromTclListAsString

Modified Paths:
--------------
    users/rhwood/MacPorts.Framework/MPInterpreter.h
    users/rhwood/MacPorts.Framework/MPInterpreter.m

Modified: users/rhwood/MacPorts.Framework/MPInterpreter.h
===================================================================
--- users/rhwood/MacPorts.Framework/MPInterpreter.h	2007-10-08 19:23:20 UTC (rev 29755)
+++ users/rhwood/MacPorts.Framework/MPInterpreter.h	2007-10-08 19:25:37 UTC (rev 29756)
@@ -28,6 +28,7 @@
 
 - (NSArray *)arrayFromTclListAsString:(NSString *)list;
 - (NSDictionary *)dictionaryFromTclListAsString:(NSString *)list;
+- (NSMutableDictionary *)mutableDictionaryFromTclListAsString:(NSString *)list;
 
 - (NSArray *)getVariableAsArray:(NSString *)variable;
 - (NSString *)getVariableAsString:(NSString *)variable;

Modified: users/rhwood/MacPorts.Framework/MPInterpreter.m
===================================================================
--- users/rhwood/MacPorts.Framework/MPInterpreter.m	2007-10-08 19:23:20 UTC (rev 29755)
+++ users/rhwood/MacPorts.Framework/MPInterpreter.m	2007-10-08 19:25:37 UTC (rev 29756)
@@ -103,6 +103,10 @@
 }
 
 - (NSDictionary *)dictionaryFromTclListAsString:(NSString *)list {
+	return [NSDictionary dictionaryWithDictionary:[self mutableDictionaryFromTclListAsString:list]];
+}
+
+- (NSMutableDictionary *)mutableDictionaryFromTclListAsString:(NSString *)list {
 	NSMutableDictionary *dictionary;
 	NSArray *array;
 	int i;
@@ -111,7 +115,7 @@
 	for (i = 0; i < [array count]; i += 2) {
 		[dictionary setObject:[array objectAtIndex:(i + 1)] forKey:[array objectAtIndex:i]];
 	}
-	return [NSDictionary dictionaryWithDictionary:dictionary];
+	return dictionary;
 }
 
 - (NSArray *)getVariableAsArray:(NSString *)variable {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071008/42890965/attachment.html


More information about the macports-changes mailing list