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

Update InListOps.kt #2261

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

GeorgCantor
Copy link

Description

Summary of the change: These changes improve both performance and readability while maintaining the original functionality of the code.

Detailed description:

Single Check for Iterator: We store the result of iterator.hasNext() in hasElements to avoid multiple calls.

Streamlined Column Type Handling: We use columnTypes.size instead of singleOrNull() for clarity and efficiency.

Helper Function for Operator Appending: The appendOperator function reduces redundancy in appending SQL operators based on whether it's an IN or NOT IN operation.

Concise Empty List Handling: The handling of an empty list is more straightforward, directly returning after appending the appropriate boolean value.


Type of Change

Please mark the relevant options with an "X":

  • Bug fix
  • New feature
  • Documentation update

Updates/remove existing public API methods:

  • Is breaking change

Affected databases:

  • MariaDB
  • Mysql5
  • Mysql8
  • Oracle
  • Postgres
  • SqlServer
  • H2
  • SQLite

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)
  • All public methods affected by my PR has up to date API docs
  • Documentation for my change is up to date

Related Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant