Skip to content

Commit

Permalink
INTERNAL: Remove unnecessary lines in the version check of get API
Browse files Browse the repository at this point in the history
  • Loading branch information
ing-eoking authored and jhpark816 committed Jan 9, 2025
1 parent e31c51b commit 46d063a
Showing 1 changed file with 25 additions and 34 deletions.
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;
}
else
{
/* >= 1.13.0 */
if (instance->major_version > 1 || (instance->major_version == 1 && instance->minor_version >= 13))
return true;
}
}
/* 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

0 comments on commit 46d063a

Please sign in to comment.