You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by tw...@apache.org on 2022/11/14 09:46:32 UTC
[incubator-kvrocks] branch unstable updated: Fix performance-faster-string-find warning reported by clang-tidy (#1109)
This is an automated email from the ASF dual-hosted git repository.
twice pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 6393cf6f Fix performance-faster-string-find warning reported by clang-tidy (#1109)
6393cf6f is described below
commit 6393cf6fcbc1ba86de1c763efcd325f9d6cf0172
Author: Maxim Smolskiy <mi...@mail.ru>
AuthorDate: Mon Nov 14 12:46:25 2022 +0300
Fix performance-faster-string-find warning reported by clang-tidy (#1109)
---
.clang-tidy | 2 +-
src/types/redis_stream_base.cc | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.clang-tidy b/.clang-tidy
index 3040614c..3c43a366 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,7 +1,7 @@
# refer to https://clang.llvm.org/extra/clang-tidy/checks/list.html
Checks: -*, clang-analyzer-core.*, clang-analyzer-cplusplus.*, clang-analyzer-deadcode.*, clang-analyzer-nullability.*, clang-analyzer-security.*, clang-analyzer-unix.*, clang-analyzer-valist.*, cppcoreguidelines-init-variables, cppcoreguidelines-macro-usage, cppcoreguidelines-interfaces-global-init, cppcoreguidelines-narrowing-conversions, cppcoreguidelines-no-malloc, cppcoreguidelines-prefer-member-initializer, cppcoreguidelines-special-member-functions, cppcoreguidelines-slicing, goog [...]
-WarningsAsErrors: clang-analyzer-*, -clang-analyzer-security.insecureAPI.rand, cppcoreguidelines-interfaces-global-init, cppcoreguidelines-no-malloc, cppcoreguidelines-slicing, google-*, modernize-use-emplace, modernize-use-equals-default, modernize-use-equals-delete, performance-implicit-conversion-in-loop, performance-inefficient-algorithm, performance-move-constructor-init, performance-no-automatic-move, performance-trivially-destructible, performance-type-promotion-in-math-fn, perfor [...]
+WarningsAsErrors: clang-analyzer-*, -clang-analyzer-security.insecureAPI.rand, cppcoreguidelines-interfaces-global-init, cppcoreguidelines-no-malloc, cppcoreguidelines-slicing, google-*, modernize-use-emplace, modernize-use-equals-default, modernize-use-equals-delete, performance-implicit-conversion-in-loop, performance-inefficient-algorithm, performance-move-constructor-init, performance-no-automatic-move, performance-trivially-destructible, performance-type-promotion-in-math-fn, perfor [...]
CheckOptions:
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
diff --git a/src/types/redis_stream_base.cc b/src/types/redis_stream_base.cc
index c05c470d..7ed399cf 100644
--- a/src/types/redis_stream_base.cc
+++ b/src/types/redis_stream_base.cc
@@ -61,7 +61,7 @@ rocksdb::Status GetNextStreamEntryID(const StreamEntryID &last_id, StreamEntryID
}
Status ParseStreamEntryID(const std::string &input, StreamEntryID *id) {
- auto pos = input.find("-");
+ auto pos = input.find('-');
if (pos != std::string::npos) {
auto ms_str = input.substr(0, pos);
auto seq_str = input.substr(pos + 1);
@@ -84,7 +84,7 @@ Status ParseStreamEntryID(const std::string &input, StreamEntryID *id) {
}
Status ParseNewStreamEntryID(const std::string &input, NewStreamEntryID *id) {
- auto pos = input.find("-");
+ auto pos = input.find('-');
if (pos != std::string::npos) {
auto ms_str = input.substr(0, pos);
auto seq_str = input.substr(pos + 1);
@@ -118,7 +118,7 @@ Status ParseNewStreamEntryID(const std::string &input, NewStreamEntryID *id) {
Status ParseRangeStart(const std::string &input, StreamEntryID *id) { return ParseStreamEntryID(input, id); }
Status ParseRangeEnd(const std::string &input, StreamEntryID *id) {
- auto pos = input.find("-");
+ auto pos = input.find('-');
if (pos != std::string::npos) {
auto ms_str = input.substr(0, pos);
auto seq_str = input.substr(pos + 1);