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

The toString function can consume less CPU and tests

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 0.8
    • None
    • Java - Compiler
    • None
    • Patch Available

    Description

      The toString member of generates classes don't need:

      1. to test the isFirst value.
      The compiler allready know it and can handle the last comma himself

      2. to handle special case for nullable object.
      StrinBuilder is used for create the resulting string.
      This append method always append the string "null" for null objects.
      But the result of append(char[] data) with null is not specified; who care. We don't use it!

      Attachments

        1. toString.patch
          2 kB
          Verdoïa Laurent

        Activity

          People

            jking3 James E. King III
            laurent2 Verdoïa Laurent
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: