Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-6218

Optimize condition in if statement to reduce the number of comparisons

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 0.9.0.0, 0.9.0.1, 0.10.0.0, 0.10.0.1, 0.10.1.0, 0.10.1.1, 0.10.2.0, 0.10.2.1, 0.11.0.0, 0.11.0.1, 1.0.0
    • Fix Version/s: 1.1.0
    • Component/s: KafkaConnect
    • Labels:

      Description

      Optimizing the condition in *if *statement
      (schema.name() == null || !(schema.name().equals(LOGICAL_NAME))) which
      requires two comparisons in worst case with
      (!LOGICAL_NAME.equals(schema.name())) which requires single comparison
      in all cases and avoids null pointer exception.

        Attachments

        1. kafka_optimize_if.JPG
          46 kB
          sachin bhalekar

          Issue Links

            Activity

              People

              • Assignee:
                sachinbhalekar sachin bhalekar
                Reporter:
                sachinbhalekar sachin bhalekar
                Reviewer:
                Ewen Cheslack-Postava
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: