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

INTERNAL: Remove unnecessary lines in the version check of get API #335

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 25 additions & 34 deletions libmemcached/get.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,50 +56,41 @@

static inline bool mget_command_is_supported(memcached_st *ptr, memcached_server_write_instance_st instance)
{
if (instance->major_version == UINT8_MAX || instance->minor_version == UINT8_MAX)
{
return false;
}

/* mgets */
if (ptr->flags.support_cas)
{
if (instance->major_version != UINT8_MAX && instance->minor_version != UINT8_MAX)
if (instance->is_enterprise)
{
if (instance->is_enterprise)
{
/* >= 0.9.0-E */
if (instance->major_version > 0 || (instance->major_version == 0 && instance->minor_version >= 9))
{
return true;
}
}
else
{
/* >= 1.13.0 */
if (instance->major_version > 1 || (instance->major_version == 1 && instance->minor_version >= 13))
{
return true;
}
}
/* >= 0.9.0-E */
if (instance->major_version > 0 || (instance->major_version == 0 && instance->minor_version >= 9))
return true;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ•„λž˜μ™€ 같이 κ΄„ν˜Έλ₯Ό μ œκ±°ν•©μ‹œλ‹€.

      /* >= 0.9.0-E */
      if (instance->major_version > 0 || (instance->major_version == 0 && instance->minor_version >= 9))
        return true;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μˆ˜μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

else
{
/* >= 1.13.0 */
if (instance->major_version > 1 || (instance->major_version == 1 && instance->minor_version >= 13))
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ—¬κΈ°λ§Œ κ³ μΉ˜μ§€ μ•ŠλŠ”κ΅°μš”.
μ΅œμ†Œν•œμ˜ μ„±μ˜κ°€ 보이지 μ•ŠμŠ΅λ‹ˆλ‹€.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μˆ˜μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

}
}
/* mget */
else
{
if (instance->major_version != UINT8_MAX && instance->minor_version != UINT8_MAX)
if (instance->is_enterprise)
{
if (instance->is_enterprise)
{
/* >= 0.7.0-E */
if (instance->major_version > 0 || (instance->major_version == 0 && instance->minor_version >= 7))
{
return true;
}
}
else
{
/* >= 1.11.0 */
if (instance->major_version > 1 || (instance->major_version == 1 && instance->minor_version >= 11))
{
return true;
}
}
/* >= 0.7.0-E */
if (instance->major_version > 0 || (instance->major_version == 0 && instance->minor_version >= 7))
return true;
}
else
{
/* >= 1.11.0 */
if (instance->major_version > 1 || (instance->major_version == 1 && instance->minor_version >= 11))
return true;
}
}
return false;
Expand Down
Loading