mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Merge pull request #23663 from ClickHouse/fix-pvs
Fix a few PVS-Studio warnings
This commit is contained in:
commit
3891205f50
@ -24,6 +24,8 @@
|
||||
|
||||
#include <cassert>
|
||||
#include <stack>
|
||||
#include <limits>
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -91,7 +93,7 @@ static String extractFixedPrefixFromLikePattern(const String & like_pattern)
|
||||
*/
|
||||
static String firstStringThatIsGreaterThanAllStringsWithPrefix(const String & prefix)
|
||||
{
|
||||
/** Increment the last byte of the prefix by one. But if it is 255, then remove it and increase the previous one.
|
||||
/** Increment the last byte of the prefix by one. But if it is max (255), then remove it and increase the previous one.
|
||||
* Example (for convenience, suppose that the maximum value of byte is `z`)
|
||||
* abcx -> abcy
|
||||
* abcz -> abd
|
||||
@ -101,7 +103,7 @@ static String firstStringThatIsGreaterThanAllStringsWithPrefix(const String & pr
|
||||
|
||||
String res = prefix;
|
||||
|
||||
while (!res.empty() && static_cast<UInt8>(res.back()) == 255)
|
||||
while (!res.empty() && static_cast<UInt8>(res.back()) == std::numeric_limits<UInt8>::max())
|
||||
res.pop_back();
|
||||
|
||||
if (res.empty())
|
||||
@ -1346,7 +1348,7 @@ KeyCondition::Description KeyCondition::getDescription() const
|
||||
Or,
|
||||
};
|
||||
|
||||
Type type;
|
||||
Type type{};
|
||||
|
||||
/// Only for Leaf
|
||||
const RPNElement * element = nullptr;
|
||||
|
@ -39,7 +39,6 @@ ReplicatedFetchInfo ReplicatedFetchListElement::getInfo() const
|
||||
res.source_replica_port = source_replica_port;
|
||||
res.interserver_scheme = interserver_scheme;
|
||||
res.uri = uri;
|
||||
res.interserver_scheme = interserver_scheme;
|
||||
res.to_detached = to_detached;
|
||||
res.elapsed = watch.elapsedSeconds();
|
||||
res.progress = progress.load(std::memory_order_relaxed);
|
||||
|
Loading…
Reference in New Issue
Block a user