Uploaded image for project: 'AeroGear'
  1. AeroGear
  2. AEROGEAR-6791

MPNSPushNotificationSender - Use isEmpty() to check whether the collection is empty or not

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None

      In /unifiedpush/message/sender/MPNSPushNotificationSender.java, you can find checks like

       if (images.size() >= 1) {
                           //DO sth
      }
      

      or

       if (textFields.size() >= 1) {
                  // DO sth
       }
      

      They can be changed by using isEmpty method.
      Using Collection.size() to test for emptiness works, but using Collection.isEmpty() makes the code more readable and can be more performant. The time complexity of any isEmpty() method implementation should be O(1) whereas some implementations of size() can be O

              Unassigned Unassigned
              polina.n.koleva Polina Koleva (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: