Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-13077

add isEmpty() to StringBuffer

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: Later
    • Fix Version/s: 6.0.0
    • Component/s: JLib
    • Labels:
      None

      Description

      StringAttr has the function -

      inline bool isEmpty() const { return !text||!*text; }
      

      that is commented as being faster than (length==0).

      If so, we could add this to StringBuffer (perhaps others) and mass replace through out the platform?

      Is this increase specific to the use of '==' or does this make any difference when the following is used:

       if (!buffer.length()) 

      or

       if (buffer.length()) 

      as opposed to

       if (!buffer.isEmpty()) 

        Attachments

          Activity

            People

            • Assignee:
              jamienoss Jamie Noss
              Reporter:
              jamienoss Jamie Noss
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: