Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply minor code refactoring #123

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Commits on May 13, 2023

  1. Replace String.indexOf() with String.contains

    Because you only want to check if textToSearch contains substring.
    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    e94e89e View commit details
    Browse the repository at this point in the history
  2. Use enhanced for loop

    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    a4f09a2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    22ba68e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e6034ff View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4ac36db View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    939c9b2 View commit details
    Browse the repository at this point in the history
  7. Use char instead of string

    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    5c10560 View commit details
    Browse the repository at this point in the history
  8. Replace Collections.sort()

    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    ab771cc View commit details
    Browse the repository at this point in the history
  9. Remove 2nd argument in String.substring()

    length of string is implicit
    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    5284c36 View commit details
    Browse the repository at this point in the history
  10. Remove 2nd argument in String.substring()

    length of string is implicit
    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    264f227 View commit details
    Browse the repository at this point in the history
  11. Replace append per line

    Is the append per line approach really more readable considering the logic. I'd argue it is not so why not keep the size of the byte code minimal
    
    more info: https://stackoverflow.com/questions/37672785/how-can-i-improve-performance-if-append-is-called-on-stringbuffer-or-stringb
    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    c0ecc91 View commit details
    Browse the repository at this point in the history
  12. Use Integer.compare()

    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    830c425 View commit details
    Browse the repository at this point in the history
  13. Simplify

    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    835286d View commit details
    Browse the repository at this point in the history
  14. Replace Collections.sort()

    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    d5db185 View commit details
    Browse the repository at this point in the history
  15. Use Integer.compare()

    sekaiser committed May 13, 2023
    Configuration menu
    Copy the full SHA
    2f24685 View commit details
    Browse the repository at this point in the history