Darius Jankauskas created THRIFT-5309:
-----------------------------------------

             Summary: Converting nested TMap into Dictionary
                 Key: THRIFT-5309
                 URL: https://issues.apache.org/jira/browse/THRIFT-5309
             Project: Thrift
          Issue Type: New Feature
          Components: Swift - Library
            Reporter: Darius Jankauskas


I find myself writing a lot of code to convert a nested TMap back into normal 
nested Dictionary. For example:

 
{code:java}
let thriftDict: TMap<String, TMap<Int64, Double>> // given this
var result = [String:[Int64:Double]]()
for (key, value) in thriftDict {
    result[key] = value.dictionary
}
{code}
Having TMap to begin with seems very un-Swifty but I realise getting rid of it 
is probably too big of a task at this point.

I wonder if there's a way to make the above code generic and include in the 
TMap implementation as `dictionaryDeepCopy`.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to