Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5309

Converting nested TMap into Dictionary

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • Swift - Library
    • None

    Description

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

       

      let thriftDict: TMap<String, TMap<Int64, Double>> // given this
      var result = [String:[Int64:Double]]()
      for (key, value) in thriftDict {
          result[key] = value.dictionary
      }
      

      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`.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            kirviz Darius Jankauskas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: