Skip to content

Update InListOps.kt#2261

Open
GeorgCantor wants to merge 1 commit intoJetBrains:mainfrom
GeorgCantor:patch-1
Open

Update InListOps.kt#2261
GeorgCantor wants to merge 1 commit intoJetBrains:mainfrom
GeorgCantor:patch-1

Conversation

@GeorgCantor
Copy link
Copy Markdown

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